1
1
Fork 0
mirror of https://github.com/tonydamage/nux-env.git synced 2025-12-11 13:24:28 +01:00

Use graphicsmagick if possible.

Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
This commit is contained in:
Tony Tkáčik 2019-11-28 12:20:36 +01:00
parent 8cc7401fe2
commit 8b3ae7ac0b
2 changed files with 9 additions and 5 deletions

View file

@ -1,7 +1,9 @@
#!/usr/bin/env nuxr-nuxsh
type ffmpeg > /dev/null 2>&1 && FFMPEG_OR_LIBAV=ffmpeg
type avconv > /dev/null 2>&1 && FFMPEG_OR_LIBAV=avconv
type gm /dev/null 2>&1 && NUX_MAGICK=gm
QUALITY=${QUALITY:=90}
@ -36,10 +38,10 @@ QUALITY=${QUALITY:=90}
target_file="${target_dir}/$name";
fi
echo "Image: $i/$count Downsampling $image -> $target_file"
convert $image \
$NUX_MAGICK convert $image \
-filter Lanczos -sampling-factor 1x1 \
-resize "${SIZE}x${SIZE}>" \
-quality 90 \
-quality $QUALITY \
$target_file
done
}
@ -66,5 +68,5 @@ QUALITY=${QUALITY:=90}
}
function media.to.jpg {
convert "$1" -quality $QUALITY -auto-orient "$2"
$NUX_MAGICK convert "$1" -quality $QUALITY -auto-orient "$2"
}