mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-30 06:03:40 +08:00
Fixed a dirs bug for catimg
This commit is contained in:
parent
0185d9920b
commit
349fa15b18
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
if [[ -x `which convert` ]]; then
|
if [[ -x `which convert` ]]; then
|
||||||
function catimg() {
|
function catimg() {
|
||||||
source $(dirname $0)/catimg.sh $@
|
source $ZSH/plugins/catimg/catimg.sh $@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
echo "catimg need convert (ImageMagick) to work)"
|
echo "catimg need convert (ImageMagick) to work)"
|
||||||
|
|
|
@ -43,7 +43,7 @@ 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=$(convert "$IMG" -print "%w\n" /dev/null)
|
||||||
if [ "$WIDTH" -gt "$COLS" ]; then
|
if [ "$WIDTH" -gt "$COLS" ]; then
|
||||||
WIDTH=$COLS
|
WIDTH=$COLS
|
||||||
fi
|
fi
|
||||||
|
@ -58,6 +58,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Display the image
|
# Display the image
|
||||||
|
I=0
|
||||||
convert "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- |
|
convert "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- |
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user