# express-photo-gallery

> Express middleware which serves a stylish and responsive photo gallery using jQuery lightgallery.

Latest version **1.0.9** (published 2017-04-09) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install express-photo-gallery
pnpm add express-photo-gallery
yarn add express-photo-gallery
bun add express-photo-gallery
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2017-04-09 |
| First published | 2016-07-09 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 12 |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 29 |
| Author | timmydoza |
| Maintainers | timmydoza |
| Keywords | photo, photos, lightgallery, gallery, photogallery |

## Links

- npm: https://www.npmjs.com/package/express-photo-gallery
- Repository: https://github.com/timmydoza/express-photo-gallery
- Homepage: https://github.com/timmydoza/express-photo-gallery#readme
- Issues: https://github.com/timmydoza/express-photo-gallery/issues
- npm.io page: https://npm.io/package/express-photo-gallery

## Dependencies (12)

- [router](https://npm.io/package/router.md) ^1.3.0
- [xml2js](https://npm.io/package/xml2js.md) ^0.4.17
- [lg-zoom](https://npm.io/package/lg-zoom.md) ^1.0.4
- [request](https://npm.io/package/request.md) ^2.81.0
- [mustache](https://npm.io/package/mustache.md) ^2.3.0
- [deep-equal](https://npm.io/package/deep-equal.md) ^1.0.1
- [lg-thumbnail](https://npm.io/package/lg-thumbnail.md) ^1.0.3
- [lightgallery](https://npm.io/package/lightgallery.md) ^1.3.9
- [serve-static](https://npm.io/package/serve-static.md) ^1.12.1
- [lg-fullscreen](https://npm.io/package/lg-fullscreen.md) ^1.0.1
- [object-assign](https://npm.io/package/object-assign.md) ^4.1.1
- [directory-exists](https://npm.io/package/directory-exists.md) ^1.0.1

## Recent versions

- 1.0.9 (latest) — 2017-04-09
- 1.0.8 — 2017-04-09
- 1.0.7 — 2016-10-04
- 1.0.6 — 2016-10-04
- 1.0.5 — 2016-10-04
- 1.0.4 — 2016-10-04
- 1.0.3 — 2016-07-12
- 1.0.2 — 2016-07-12
- 1.0.1 — 2016-07-11
- 1.0.0 — 2016-07-11
- 0.0.5 — 2016-07-10
- 0.0.4 — 2016-07-10
- 0.0.3 — 2016-07-09
- 0.0.2 — 2016-07-09
- 0.0.1 — 2016-07-09

## README

# express-photo-gallery
[![Build Status](https://travis-ci.org/timmydoza/express-photo-gallery.svg?branch=master)](https://travis-ci.org/timmydoza/express-photo-gallery)

EPG (express-photo-gallery) is a node module that creates an Express.js middleware function for hosting stylish and responsive photo galleries using [jQuery lightgallery](http://sachinchoolur.github.io/lightGallery/).

[See a sample gallery here](http://timmydoza.com/express-photo-gallery).

## Usage:

#### Install:
`npm install express-photo-gallery`

#### Implement:
```
var express = require('express');
var app = express();

var Gallery = require('express-photo-gallery');

var options = {
  title: 'My Awesome Photo Gallery'
};

app.use('/photos', Gallery('path_to_photos', options));

app.listen(3000);
```

That's it!  [See it in action here](http://timmydoza.com/express-photo-gallery).

EPG will automatically look through the provided directory for a `thumbs` subdirectory and `previews` subdirectory, which should both contain files with the same filenames as those in the base folder.  For example:

```
path_to_photos
├── file1.jpg
├── file2.jpg
├── file3.jpg
├── previews
│   ├── file1.jpg
│   ├── file2.jpg
│   └── file3.jpg
└── thumbs    
    ├── file1.jpg
    ├── file2.jpg
    └── file3.jpg
```
If your photo directory does not have `thumbs` or `previews`, EPG will host the images in the base directory, without displaying thumbnails.  

If you would like to generate `thumbs` and `previews` automatically, use `epg-prep`:

## epg-prep

`epg-prep` is a mutithreaded command-line helper utility which automatically generates image previews and thumbnails from a directory of jpg images.  The previews and thumbnails are stored in `previews` and `thumbs` subdirectories, respectively.

Note: `epg-prep` must be installed globally.

`npm install -g epg-prep`

`epg-prep path_to_photos`

Using `epg-prep` to generate `thumbs` and `previews` subdirectories is especially useful if you have a directory of large photos from a digital camera.

#### GraphicsMagick or ImageMagick

`epg-prep` depends on [ImageMagick](http://www.imagemagick.org/script/index.php) or [GraphicsMagick](http://www.graphicsmagick.org/), so make sure they are installed on your system and properly set up in your PATH.

Ubuntu:
```
apt-get install imagemagick
apt-get install graphicsmagick
```

Mac OS X (using Homebrew):
```
brew install imagemagick
brew install graphicsmagick
```


Confirm that ImageMagick is properly set up by executing `convert -help` in a terminal.

### Todo:

- Add support for more file types
- Add ability to add prefix to files in `previews` and `thumbs`
- Tests for erg-prep
- Add feature to randomize photo order on each load

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