commit 0c46370da3bdbc122b64a5811cad43b8cbdb5eab
parent 634c3ec6a6e0cb045838ff5411dbe4ec767aa76c
Author: FRIGN <dev@frign.de>
Date: Tue, 17 Nov 2015 18:27:56 +0100
Add 2ff utility
This is a wrapper for the different conversion utilities with
filetype detection using file(1) and an imagemagick fallback.
Diffstat:
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/2ff 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;
diff --git a/Makefile b/Makefile
@@ -17,7 +17,7 @@ clean:
install:
@echo installing into ${DESTDIR}${PREFIX}/bin
@mkdir -p ${DESTDIR}${PREFIX}/bin
- @cp -f png2ff ff2png ${DESTDIR}${PREFIX}/bin
+ @cp -f png2ff ff2png 2ff ${DESTDIR}${PREFIX}/bin
uninstall:
@echo removing from ${DESTDIR}${PREFIX}/bin