# focal

> node.js photo gallery

Latest version **0.1.0** (published 2014-08-06) · GPLv3 license · 0 weekly downloads

## Install

```sh
npm install focal
pnpm add focal
yarn add focal
bun add focal
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2014-08-06 |
| First published | 2014-08-01 |
| Weekly downloads | 0 |
| License | GPLv3 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Known vulnerabilities | 0 (+14 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Nicolas Joyard |
| Maintainers | njoyard |
| Keywords | gallery, photo, picture |

## Links

- npm: https://www.npmjs.com/package/focal
- Repository: https://github.com/njoyard/focal
- Issues: http://github.com/njoyard/focal/issues
- npm.io page: https://npm.io/package/focal

## Dependencies (11)

- [exif](https://npm.io/package/exif.md) ^0.4.0
- [yarm](https://npm.io/package/yarm.md) ^0.3.7
- [log4js](https://npm.io/package/log4js.md) ^0.6.16
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.0
- [express](https://npm.io/package/express.md) ^4.7.2
- [mongodb](https://npm.io/package/mongodb.md) ^1.4.7
- [chokidar](https://npm.io/package/chokidar.md) ^0.8.2
- [mongoose](https://npm.io/package/mongoose.md) ^3.8.14
- [optimist](https://npm.io/package/optimist.md) ^0.6.1
- [less-middleware](https://npm.io/package/less-middleware.md) ^1.0.3
- [imagemagick-native](https://npm.io/package/imagemagick-native.md) ^1.2.2

## Recent versions

- 0.1.0 (latest) — 2014-08-06
- 0.0.0 — 2014-08-01

## README

Focal - node.js picture gallery
===============================

Focal is a simple web-based picture gallery written with node.js and express.

Requirements
------------

Focal uses mongodb to store information about images, and as it uses text search, it requires at least version 2.6.  You will also need to have the ImageMagick library and its header files installed (`libmagick++-dev` on debian-based distributions), so that Focal is able to resize images.

Installation
------------

Use npm to install Focal:

```sh
$ npm install -g focal
```

Configuration
-------------

Focal uses a JSON configuration file.  [An example configuration file](config.json) is available at the root of the repository.

Configuration key | Description
--- | ---
**galleryName** | Gallery title
**database** | Mongodb database URI (eg. `mongodb://localhost/focal`)
**server.host** | Web server IP
**server.port** | Web server port
**images.base** | Base directory for storing images. Focal should be able to write to this directory.
**images.previews.quality** | JPEG quality for image previews
**images.thumbnails.quality** | JPEG quality for image thumbnails
**images.thumbnails.size** | Thumbnail size in pixels
**images.thumbnails.crop** | Boolean; indicates whether to crop thumbnails to a square image
**log4js** | Log4js configuration (optional)

Galleries and pictures
----------------------

Focal serves pictures from the `images` subdirectory of the `images.base` directory.  You can organize pictures in folders and subfolders (with unlimited depth); Focal will display each folder as a gallery (or a sub-gallery) and will use filenames as picture titles.

Previews and thumbnails are automatically generated the first time they are served.  Focal stores them in the `previews` and `thumbs` subdirectories inside the `images.base` directory.

Focal automatically detects new and removed pictures from the `images` subdirectory.

Running Focal
-------------

From the command line:

```sh
$ focal [--config=/path/to/config.json]
```

If you don't specify the `--config` option, Focal will look for a `config.json` file inside the current directory.

---
_Source: https://npm.io/package/focal · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
