| assets | ||
| templates | ||
| create-gallery.py | ||
| license.txt | ||
| readme.md | ||
| requirements.txt | ||
| sort-images.py | ||
Scripts for Image Gallery Creation
This is a collection of scripts, templates and assets to sort pictures by different photographers at different days of the same event and create a neat summery html page.
Prerequisites
You will probably need:
- Python 3.5 (or newer)
- Python packages
python-xmp-toolkit,pillowandjinja2 - Some image organizing tool like digiKam to edit metatags
exiftoolto edit metatagsexiftranto rotate images
Debian/Ubuntu:
$ sudo apt install python3 python3-pip exiftool exiftran
$ pip3 install --user -r requirements.txt
Arch Linux:
$ sudo pacman -S python python-pip perl-image-exiftool fbida
$ pip3 install --user -r requirements.txt
How to
-
Rotate images according to EXIF tags:
$ exiftran -ai path/to/pictures/*.jpg -
Fix XMP
CreateDateof pictures from cameras with unsynced clock
Typically you can rely on the EXIFDateTimeOriginaltag to be set by cameras. Also, a lot of image viewers only display this tag. So we use it as source timestamp and update all the common timestamp tags.$ exiftool -overwrite_original -globalTimeShift <[-]hh:mm:ss> \ -"DateTimeOriginal<DateTimeOriginal" -"DateTimeDigitized<DateTimeOriginal" \ -"CreateDate<DateTimeOriginal" -"ModifyDate<DateTimeOriginal" \ path/to/pictures/ -
Add XMP
CreatorandSubjecttags
… e.g. by using digiKam's meta data templates and tags and explicitly writing the data as XMP back to file afterwards. Another way is to create XMP sidecar files with digiKam (or any other image organizing software) and use$ for i in *.jpg; do exiftool -tagsFromFile "$i.xmp" -overwrite_original -Creator -Subject "$i"; doneto write the relevant data to the JPEG file.
-
Sort images with
sort-images.py$ make-gallery/sort-images.py source1/ source2/ source3/ target/All *.jpg files from all source directory are copied to target/yyyy-mm-dd/hhiiss-II-filename.jpg, where II are the initials of the XMP Creator's name. To move the images instead of copying, use
-m, for hardlinks, use-l. To search source directories recursively, use the-rflag. -
Create HTML gallery with
create-gallery.py$ make-gallery/create-gallery.py -t "Gallery title" target/This creates a directory
target/gallery/and generates thumbnail images and a HTML gallery there.
License
The Python Scripts are licensed under MIT License: Just use them however you want, but keep my name around and accept, that I'm not liable for anything.
Lightbox2 by Lokesh Dhakar is licensed under the terms of the MIT License.
jQuery by the JS Foundation and other contributors is also licensed unter the terms of the MIT License.