Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/richbl/photography-gallery-generator

A bash script to prep (rename, resize, reduce, and watermark) a folder of images, and then generate an index in HTML
https://github.com/richbl/photography-gallery-generator

gallery generator html photography photography-gallery-generator photos watermark

Last synced: 2 months ago
JSON representation

A bash script to prep (rename, resize, reduce, and watermark) a folder of images, and then generate an index in HTML

Awesome Lists containing this project

README

        

## Photography Gallery Generator
This is a simple [BaT](https://github.com/richbl/a-bash-template) bash script that:

- Parses a folder of images (default: jpg)
- Processes these image files (reduces, resizes, and applies a watermark) using ImageMagick
- Generates an HTML index for use in a photography website

## [Developed with a Bash Template (BaT)](https://github.com/richbl/a-bash-template)[](https://github.com/richbl/a-bash-template)

This [bash](https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29) script uses a bash template (BaT) called **[A-Bash-Template](https://github.com/richbl/a-bash-template)** designed to make script development and command line argument management more robust, easier to implement, and easier to maintain. Here are a few of those features:

- Dependencies checker: a routine that checks all external program dependencies (*e.g.*, [sshpass](http://linux.die.net/man/1/sshpass) and [jq](https://stedolan.github.io/jq/))
- Arguments and script details--such as script description and syntax--are stored in the [JSON](http://www.json.org/) file format (*i.e.*, `config.json`)
- JSON queries (using [jq](https://stedolan.github.io/jq/)) handled through wrapper functions
- A script banner function automates banner generation, reading directly from `config.json`
- Command line arguments are parsed and tested for completeness using both short and long-format argument syntax (*e.g.*, `-u|--username`)
- Optional command line arguments are permissible and managed through the JSON configuration file
- Template functions organized into libraries to minimize code footprint in the main script

For more details about using a bash template, [check out the BaT project here](https://github.com/richbl/a-bash-template).

## Example
See below for an example of both a processed image file and the resulting HTML index:

```



















```
## IMPORTANT: This Project Uses Git Submodules

This project uses [Git submodule project(s)](https://git-scm.com/book/en/v2/Git-Tools-Submodules) (located in the `bash-lib` folder) to keep this project up-to-date without manual intervention.

**Be sure to clone this project with the `--recursive` switch** (`git clone --recursive https://github.com/richbl/this_project`) so any submodule project(s) will be automatically cloned as well. If you clone into this project without this switch, you'll likely see empty submodule project folders (depending on your version of Git).