Created
May 20, 2016 03:40
-
-
Save stekan/a59930cc5ab43085aa919e3d98bf110e to your computer and use it in GitHub Desktop.
Generate Thumbnail-Index with ImageMagick
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
> index.html | |
[ -d thumbs ] || mkdir thumbs | |
for f in *.png; do | |
convert $f -strip -thumbnail 200x100 thumbs/$f | |
done | |
find -maxdepth 1 -name \*.png -exec echo "<a href=\"{}\"><img src=\"thumbs/{}\" border=\"0\" style=\"margin:10px;border:1px solid #ccc;\"></a>" \; | sort >> index.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is dope and works perfectly. imagemagick, however, does now complain about using the
convert
command vsmagick
. Not sure if it'll be phased out though. Just an fyi for anyone using this script in the future: