summaryrefslogtreecommitdiff
path: root/2ff
diff options
context:
space:
mode:
authorFRIGN <dev@frign.de>2015-11-17 18:27:56 +0100
committerFRIGN <dev@frign.de>2015-11-17 18:30:19 +0100
commit0c46370da3bdbc122b64a5811cad43b8cbdb5eab (patch)
tree03c45c2cc04d9a45838f3e0c6a0c5e7d94ae624a /2ff
parent634c3ec6a6e0cb045838ff5411dbe4ec767aa76c (diff)
Add 2ff utility
This is a wrapper for the different conversion utilities with filetype detection using file(1) and an imagemagick fallback.
Diffstat (limited to '2ff')
-rwxr-xr-x2ff8
1 files changed, 8 insertions, 0 deletions
diff --git a/2ff b/2ff
new file mode 100755
index 0000000..8901c78
--- /dev/null
+++ b/2ff
@@ -0,0 +1,8 @@
+#!/bin/sh
+FORMAT=`file -ib "$1" | cut -d ";" -f 1`
+
+if [ "$FORMAT" = "image/png" ]; then
+ png2ff < "$1"
+else
+ convert "$1" png:- | png2ff
+fi;