44b23ae194a1580a6af6d692e4ba268d61828929

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

Message

catimg: fix exit without using source
supresses errors from convert whilen converting, as they
are usually just warnings

Diff

 1diff --git a/plugins/catimg/catimg.plugin.zsh b/plugins/catimg/catimg.plugin.zsh
 2index ee721cd0380b81a4145eb73193721b2066576d8e..70ef9a63cbb71763fe7279230acd193166c98475 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 $ZSH/plugins/catimg/catimg.sh $@
10+    zsh $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 c05fddcd4c43f572d14e325afa685def50f1f71e..cd0f2e3335e537083ed6e1211c8e96d3e2a4d0e4 100755
16--- a/plugins/catimg/catimg.sh
17+++ b/plugins/catimg/catimg.sh
18@@ -59,7 +59,7 @@ fi
19 
20 # Display the image
21 I=0
22-convert "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- |
23+convert "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- 2>/dev/null |
24 sed -e 's/.*none.*/NO NO NO/g' -e '1d;s/^.*(\(.*\)[,)].*$/\1/g;y/,/ /' |
25 while read R G B f; do
26   if [ ! "$R" = "NO" ]; then