summaryrefslogtreecommitdiff
path: root/plugins/catimg
diff options
context:
space:
mode:
authorEduardo San Martin Morote <posva13@gmail.com>2013-12-09 22:07:19 +0100
committerEduardo San Martin Morote <posva13@gmail.com>2013-12-09 22:07:19 +0100
commit349fa15b187a1b2c411db90f2022013caf3479e8 (patch)
treedced5747fb0e8efaf99fa6421a594b86546b6a78 /plugins/catimg
parent0185d9920b7d6c380277a4a15c9e4818df41700a (diff)
downloadzsh-349fa15b187a1b2c411db90f2022013caf3479e8.tar.gz
zsh-349fa15b187a1b2c411db90f2022013caf3479e8.tar.bz2
zsh-349fa15b187a1b2c411db90f2022013caf3479e8.zip
Fixed a dirs bug for catimg
Diffstat (limited to 'plugins/catimg')
-rw-r--r--plugins/catimg/catimg.plugin.zsh2
-rwxr-xr-xplugins/catimg/catimg.sh3
2 files changed, 3 insertions, 2 deletions
diff --git a/plugins/catimg/catimg.plugin.zsh b/plugins/catimg/catimg.plugin.zsh
index 01e81eca7..ee721cd03 100644
--- a/plugins/catimg/catimg.plugin.zsh
+++ b/plugins/catimg/catimg.plugin.zsh
@@ -9,7 +9,7 @@
if [[ -x `which convert` ]]; then
function catimg() {
- source $(dirname $0)/catimg.sh $@
+ source $ZSH/plugins/catimg/catimg.sh $@
}
else
echo "catimg need convert (ImageMagick) to work)"
diff --git a/plugins/catimg/catimg.sh b/plugins/catimg/catimg.sh
index f9e067e34..c05fddcd4 100755
--- a/plugins/catimg/catimg.sh
+++ b/plugins/catimg/catimg.sh
@@ -43,7 +43,7 @@ if [ ! "$WIDTH" ]; then
else
COLS=$(expr $WIDTH "/" $(echo -n "$CHAR" | wc -c))
fi
-WIDTH=$(convert ${IMG} -print "%w\n" /dev/null)
+WIDTH=$(convert "$IMG" -print "%w\n" /dev/null)
if [ "$WIDTH" -gt "$COLS" ]; then
WIDTH=$COLS
fi
@@ -58,6 +58,7 @@ else
fi
# Display the image
+I=0
convert "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- |
sed -e 's/.*none.*/NO NO NO/g' -e '1d;s/^.*(\(.*\)[,)].*$/\1/g;y/,/ /' |
while read R G B f; do