Created
January 16, 2018 17:33
-
-
Save emachado/1c8c24890aec4c83c9eed4ff2eb87628 to your computer and use it in GitHub Desktop.
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 | |
# bash static gallery generator | |
set -ev | |
#DESTDIR=`date +%Y%m%d` | |
DESTDIR=out | |
mkdir $DESTDIR | |
i=1 | |
for f in *.jpg ; do | |
n=`printf '%08d' $i` | |
convert $f -thumbnail 1000x1000 $DESTDIR/p$n.jpg | |
convert $f -thumbnail 150x150^ -gravity center -extent 150x150 $DESTDIR/_p$n.jpg | |
i=$[i+1] | |
done | |
cd $DESTDIR/ | |
echo "<html><head></head><body>" > index.html | |
for f in p* ; do | |
echo "<a href='$f'><img src='_$f'></a>" | |
done >> index.html | |
echo "</body></html>" >> index.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment