Create A Single JPG Gallery From An Image Archive
Join the DZone community and get the full member experience.Join For Free
The following comes from Jason Scott and is posted here with permission under the Creative Commons Attribution-ShareAlike License. The script expands a zip or rar archive of images, makes thumbnails, and compiles the thumbnails into a single JPG to represent what's in the archive. Requires ImageMagick. Code:
#!/bin/sh # GALLERATE: Turn a zip of images into a gallery. # From Jason Scott. http://ascii.textfiles.com/archives/000137.html if [ -f "$1" ] then rm -rf .galleryworld echo "[%] Preparting to squat out $1...." mkdir .galleryworld cd .galleryworld unzip -j "../$1" unrar e -ep "../$1" echo "[%] WHY DOES IT HURT!!!!" montage +frame +shadow +label -tile 7 *.JPG *.GIF *.gif *.jpg *.bmp *.png *.PNG *.BMP "../$1.jpg" cd .. rm -rf .galleryworld ls -l "$1.jpg" else echo "No such file, assmaster." fiUsage:
GALLERATE [file]where [file] is the zip or rar archive of images to be processed.
Opinions expressed by DZone contributors are their own.