mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-06 02:51:32 +01:00
fix(catimg): change deprecated convert command to magick
convert command is deprecated in ImageMagick v7
75a5c6d168
This commit is contained in:
parent
efafef8495
commit
ac206ad8f9
1 changed files with 4 additions and 4 deletions
|
|
@ -43,23 +43,23 @@ if [ ! "$WIDTH" ]; then
|
||||||
else
|
else
|
||||||
COLS=$(expr $WIDTH "/" $(echo -n "$CHAR" | wc -c))
|
COLS=$(expr $WIDTH "/" $(echo -n "$CHAR" | wc -c))
|
||||||
fi
|
fi
|
||||||
WIDTH=$(convert "$IMG" -print "%w\n" /dev/null)
|
WIDTH=$(magick "$IMG" -print "%w\n" /dev/null)
|
||||||
if [ "$WIDTH" -gt "$COLS" ]; then
|
if [ "$WIDTH" -gt "$COLS" ]; then
|
||||||
WIDTH=$COLS
|
WIDTH=$COLS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
REMAP=""
|
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"
|
REMAP="-remap $COLOR_FILE"
|
||||||
else
|
else
|
||||||
echo "The version of convert is too old, don't expect good results :(" >&2
|
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"
|
#IMG="tmp.png"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Display the image
|
# Display the image
|
||||||
I=0
|
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/,/ /' |
|
sed -e 's/.*none.*/NO NO NO/g' -e '1d;s/^.*(\(.*\)[,)].*$/\1/g;y/,/ /' |
|
||||||
while read R G B f; do
|
while read R G B f; do
|
||||||
if [ ! "$R" = "NO" ]; then
|
if [ ! "$R" = "NO" ]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue