From ac206ad8f97a265d10f28bf0f80abf7e3156e44e Mon Sep 17 00:00:00 2001 From: maxutka99 Date: Fri, 9 Aug 2024 20:14:57 +0300 Subject: [PATCH] fix(catimg): change deprecated convert command to magick convert command is deprecated in ImageMagick v7 https://github.com/ImageMagick/ImageMagick/commit/75a5c6d168379dd6e74f207468444cb2cff11720 --- plugins/catimg/catimg.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/catimg/catimg.sh b/plugins/catimg/catimg.sh index f58392428..2a3916d07 100644 --- a/plugins/catimg/catimg.sh +++ b/plugins/catimg/catimg.sh @@ -43,23 +43,23 @@ if [ ! "$WIDTH" ]; then else COLS=$(expr $WIDTH "/" $(echo -n "$CHAR" | wc -c)) fi -WIDTH=$(convert "$IMG" -print "%w\n" /dev/null) +WIDTH=$(magick "$IMG" -print "%w\n" /dev/null) if [ "$WIDTH" -gt "$COLS" ]; then WIDTH=$COLS fi REMAP="" -if convert "$IMG" -resize $COLS\> +dither -remap $COLOR_FILE /dev/null ; then +if magick "$IMG" -resize $COLS\> +dither -remap $COLOR_FILE /dev/null ; then REMAP="-remap $COLOR_FILE" else echo "The version of convert is too old, don't expect good results :(" >&2 - #convert "$IMG" -colors 256 PNG8:tmp.png + #magick "$IMG" -colors 256 PNG8:tmp.png #IMG="tmp.png" fi # Display the image I=0 -convert "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- 2>/dev/null | +magick "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- 2>/dev/null | sed -e 's/.*none.*/NO NO NO/g' -e '1d;s/^.*(\(.*\)[,)].*$/\1/g;y/,/ /' | while read R G B f; do if [ ! "$R" = "NO" ]; then