From 2885143d584df0d8a1c88e8d923070d381351e7a Mon Sep 17 00:00:00 2001 From: Rodolphe Breard Date: Sat, 12 Sep 2015 19:03:38 +0200 Subject: [PATCH] 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. --- vcf_compressor.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcf_compressor.sh b/vcf_compressor.sh index fa2f16d..6b4df2e 100755 --- a/vcf_compressor.sh +++ b/vcf_compressor.sh @@ -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