tweak thumbnailer to not modify gifs and give good feedback
This commit is contained in:
parent
7e7c2f8003
commit
76fc3e88ff
1 changed files with 8 additions and 1 deletions
|
@ -20,7 +20,11 @@ pathtrans() {
|
|||
|
||||
resize() {
|
||||
output=$(pathtrans $1)
|
||||
if echo $1 | grep .gif > /dev/null; then
|
||||
return
|
||||
fi
|
||||
if [ ! -f ${output} ]; then
|
||||
echo "generating thumbnail for $1"
|
||||
convert $1 -strip -auto-orient -resize ${SIZE} -dither FloydSteinberg -colors 16 ${output}
|
||||
fi
|
||||
replace $1 ${output}
|
||||
|
@ -35,11 +39,14 @@ replace() {
|
|||
src=$(echo "src='${src}'")
|
||||
dest=$(echo "src='${dest}'")
|
||||
|
||||
echo -n "modifying html to use thumbnail for $1"
|
||||
for f in $(find ${ROOT}/*.html); do
|
||||
if grep ${src} ${f}; then
|
||||
echo -n "."
|
||||
if grep ${src} ${f} > /dev/null; then
|
||||
sed -i s#${src}#${dest}# $f
|
||||
fi
|
||||
done
|
||||
echo
|
||||
}
|
||||
|
||||
echo "creating new thumbnails"
|
||||
|
|
Loading…
Reference in a new issue