349fa15b187a1b2c411db90f2022013caf3479e8

Author
Eduardo San Martin Morote <posva13@gmail.com>
Committer
Eduardo San Martin Morote <posva13@gmail.com>
Date

Message

Fixed a dirs bug for catimg

Diff

 1diff --git a/plugins/catimg/catimg.plugin.zsh b/plugins/catimg/catimg.plugin.zsh
 2index 01e81eca70671d3b89fbef546b22b181fc5d61ba..ee721cd0380b81a4145eb73193721b2066576d8e 100644
 3--- a/plugins/catimg/catimg.plugin.zsh
 4+++ b/plugins/catimg/catimg.plugin.zsh
 5@@ -9,7 +9,7 @@
 6 
 7 if [[ -x  `which convert` ]]; then
 8   function catimg() {
 9-    source $(dirname $0)/catimg.sh $@
10+    source $ZSH/plugins/catimg/catimg.sh $@
11   }
12 else
13   echo "catimg need convert (ImageMagick) to work)"
14diff --git a/plugins/catimg/catimg.sh b/plugins/catimg/catimg.sh
15index f9e067e348993dcffa68a2e356cd84243301ef72..c05fddcd4c43f572d14e325afa685def50f1f71e 100755
16--- a/plugins/catimg/catimg.sh
17+++ b/plugins/catimg/catimg.sh
18@@ -43,7 +43,7 @@ if [ ! "$WIDTH" ]; then
19 else
20   COLS=$(expr $WIDTH "/" $(echo -n "$CHAR" | wc -c))
21 fi
22-WIDTH=$(convert ${IMG} -print "%w\n" /dev/null)
23+WIDTH=$(convert "$IMG" -print "%w\n" /dev/null)
24 if [ "$WIDTH" -gt "$COLS" ]; then
25   WIDTH=$COLS
26 fi
27@@ -58,6 +58,7 @@ else
28 fi
29 
30 # Display the image
31+I=0
32 convert "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- |
33 sed -e 's/.*none.*/NO NO NO/g' -e '1d;s/^.*(\(.*\)[,)].*$/\1/g;y/,/ /' |
34 while read R G B f; do