summaryrefslogtreecommitdiff
path: root/2ff
diff options
context:
space:
mode:
authorDmitry Bogatov <KAction@gnu.org>2017-03-14 08:44:49 +0300
committerDmitry Bogatov <KAction@gnu.org>2017-03-14 08:44:49 +0300
commit16c1e8ac96df9e81eec9c6eb83f05ca27fac47c2 (patch)
tree96edacedc66225480d03054d4f6afdf179542442 /2ff
parent7528abdfcea6a969dac0d3e0726668dcbc220d12 (diff)
Patch 2ff script to suggest install imagemagick
Imagemagick is soft dependency of farbfeld -- usually user do not need it, since conversion from jpeg and png -- the most common formats, are built-it, but in more rare cases, when imagemagick *is* needed, user-friendly error message apperars, suggesting to install required package instead just complaining about missing `convert' binary.
Diffstat (limited to '2ff')
-rwxr-xr-x2ff5
1 files changed, 5 insertions, 0 deletions
diff --git a/2ff b/2ff
index bf58e5b..f958692 100755
--- a/2ff
+++ b/2ff
@@ -24,6 +24,11 @@ image/jpeg)
jpg2ff < "$TMP"
;;
*)
+ if [ ! -x /usr/bin/convert ] ; then
+ printf "%s: cant convert from %s -- missing \`convert' program" "$0" "$FORMAT" >&2
+ printf "Run \`apt-get install imagemagick' to install it" >&2
+ exit 1
+ fi
convert "$TMP" png:- 2>/dev/null | png2ff 2>/dev/null
;;
esac