Archived
1
0
This repository has been archived on 2023-08-12. You can view files and clone it, but cannot push or open issues or pull requests.
nntpchan/contrib/tools/thumbs.sh

24 lines
571 B
Bash
Raw Normal View History

2015-08-31 19:58:28 +05:00
#!/usr/bin/env bash
#
# shell script for regenerating thumbnails
#
if [ "$1" == "" ] ; then
echo "usage: $0 webroot_dir"
else
cd $1
echo "regenerate missing thumbs in $(pwd)"
find img/ \
-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>' \
-path 'thm/{}.jpg' \
2015-08-31 19:58:28 +05:00
-strip \
'{}' \;
fi