Fixing a size detection bug.

The conditions used to determine whether or not an image have to be
processed depending on its size were boggus. This commit fixes the
issue, images are now processed as they should.
This commit is contained in:
Rodolphe Breard 2015-09-12 19:03:38 +02:00
parent 31bf102452
commit 2885143d58

View file

@ -48,7 +48,7 @@ compress_photo () {
prefix=$(echo "$line" | cut -d ":" -f1)
width=$(raw_img "$line" | identify -format '%w' -)
height=$(raw_img "$line" | identify -format '%h' -)
if [ "$width" -le "$max_width" ] && [ "$height" -le "$max_height" ] ; then
if [ "$width" -gt "$max_width" ] || [ "$height" -gt "$max_height" ] ; then
picture=$(raw_img "$line" | convert "-" -quality 50 -resize "${max_width}x${max_height}>" "-" | base64 -w0)
echo "$prefix:$picture"
else