This repository has been archived on 2023-08-12. You can view files and clone it. You cannot open issues or pull requests or push a commit.
2015-08-31 10:58:28 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
#
|
|
|
|
|
# shell script for regenerating thumbnails
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
if [ "$1" == "" ] ; then
|
|
|
|
|
echo "usage: $0 webroot_dir"
|
|
|
|
|
else
|
2015-09-05 11:05:32 -04:00
|
|
|
cd $1/img
|
2015-08-31 10:58:28 -04:00
|
|
|
echo "regenerate missing thumbs in $(pwd)"
|
2015-09-05 11:05:32 -04:00
|
|
|
find . \
|
2015-08-31 10:58:28 -04:00
|
|
|
-type f \
|
|
|
|
|
-regextype posix-extended \
|
|
|
|
|
-iregex '.*\.(png|jpg|gif)$' \
|
|
|
|
|
-not -execdir test -f '../thm/{}' \; \
|
|
|
|
|
-exec echo 'generating missing thumb for {}' \; \
|
|
|
|
|
-exec mogrify \
|
|
|
|
|
-define jpeg:size=500x500 \
|
|
|
|
|
-thumbnail '250>x250>' \
|
2015-09-05 11:05:32 -04:00
|
|
|
-path '../thm/{}.jpg' \
|
2015-08-31 10:58:28 -04:00
|
|
|
-strip \
|
|
|
|
|
'{}' \;
|
|
|
|
|
fi
|