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
575 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
2015-09-05 20:05:32 +05:00
cd $1/img
2015-08-31 19:58:28 +05:00
echo "regenerate missing thumbs in $(pwd)"
2015-09-05 20:05:32 +05:00
find . \
2015-08-31 19:58:28 +05: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 20:05:32 +05:00
-path '../thm/{}.jpg' \
2015-08-31 19:58:28 +05:00
-strip \
'{}' \;
fi