0.1.0 • Published 10 years ago

focal v0.1.0

Weekly downloads
4
License
GPLv3
Repository
github
Last release
10 years ago

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:

$ npm install -g focal

Configuration

Focal uses a JSON configuration file. An example configuration file is available at the root of the repository.

Configuration keyDescription
galleryNameGallery title
databaseMongodb database URI (eg. mongodb://localhost/focal)
server.hostWeb server IP
server.portWeb server port
images.baseBase directory for storing images. Focal should be able to write to this directory.
images.previews.qualityJPEG quality for image previews
images.thumbnails.qualityJPEG quality for image thumbnails
images.thumbnails.sizeThumbnail size in pixels
images.thumbnails.cropBoolean; indicates whether to crop thumbnails to a square image
log4jsLog4js 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:

$ 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.