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:
parent
31bf102452
commit
2885143d58
1 changed files with 1 additions and 1 deletions
|
@ -48,7 +48,7 @@ compress_photo () {
|
||||||
prefix=$(echo "$line" | cut -d ":" -f1)
|
prefix=$(echo "$line" | cut -d ":" -f1)
|
||||||
width=$(raw_img "$line" | identify -format '%w' -)
|
width=$(raw_img "$line" | identify -format '%w' -)
|
||||||
height=$(raw_img "$line" | identify -format '%h' -)
|
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)
|
picture=$(raw_img "$line" | convert "-" -quality 50 -resize "${max_width}x${max_height}>" "-" | base64 -w0)
|
||||||
echo "$prefix:$picture"
|
echo "$prefix:$picture"
|
||||||
else
|
else
|
||||||
|
|
Reference in a new issue