minuscule static gallery

picture

imgram mini uses no database. it uses filenames and unix epoch dates for building the website. It's in plain html and will work with any webserver that can render html files.

See live example here.

Download.

features

dependecies

usage

Download the program and edit it. Change the first 4 variables appropriately:

ppp

Posts per page - if the number of images is larger than this number, paginate.

ie: ppp=20

wroot

Directory where the gallery lives.

ie: wroot=/var/www/htdocs/mywebsite/imgmini

rss_url

Full url of your imgmini gallery.

ie: rss_url=https://mywebsite.com/imgmini

rss_desc

Description of your imgmini rss feed.

ie: rss_desc="my imgmini gallery"

note

If your system uses GNU date, uncomment #dt="date -d @"

(you can test this by running date -r 1. if it returns an error, uncomment the line.)

The user running imgmini must have write permissions in $wroot and /tmp

By default, imgmini resizes thumbnails to 860px wide jpgs. You can customize the conversion by editing the cnvrt() function. The jpg format is hardcoded in, you probably shouldn't change that.

By default, imgmini comes with very bare html. You can customize it by editing the html() function. Be sure to leave in the $(cat $1) and $(pager) operations.

Descriptions are placed in a plaintext file with the same id as the image.

# post new picture file.jpg
$ imgmini "file.jpg" "description (optional)"

# rebuild www and rss
$ imgmini

# delete picture 101.jpg:
# go to $wroot and delete 101.jpg and 101 (if it exists), then run
$ imgmini

# edit description for image 101.jpg:
# edit $wroot/101, then run:
$ imgmini

caveats

imgmini doesn't care if you feed it a file that's not an image. It will try to post it.

imgmini might get confused if you place other files into $wroot, other than the ones it makes itself.

Tested with OpenBSD 7.8 and Debian 11.

license

nein

more

nein