summaryrefslogtreecommitdiff
path: root/2ff
AgeCommit message (Collapse)Author
2017-04-14Don't suppress imagemagick and png2ff(1) warningsLaslo Hunhold
Else the user might be left wondering what happened. The output from imagemagick might not be the nicest in the world, but it's bearable for some given edge-cases.
2017-04-14Refactor 2ff(1)Laslo Hunhold
The Unix philosophy teaches us that tools should strive to output only necessary diagnostic information and also reflect errors properly with the return value. There were three subtle problems with 2ff: 1) If the farbfeld-passthrough failed, it would return 1 instead of 1. 2) If the first 8 bytes contained a NUL byte, bash would print an ugly warning message. Passing it through tr -d '\0' fixes that. 3) Lack of comments. I added some to make the structure even clearer, also including using an if-else-structure. I removed the 2ff error message; the tools themselves print proper messages already.
2016-09-192ff: use trap to remove temporary fileFRIGN
This also frees us from having to store the return value somewhere.
2016-09-192ff: make it more portableFRIGN
Thanks Roberto and Evan Gates!
2016-09-192ff: Make it idempotent and clean it up a bitFRIGN
If a file begins with "farbfeld", we just pass it through.
2016-09-07Shellcheck 2ff fixesFRIGN
I was inspired by the current discussion on dev@ to use shellcheck to check my scripts and thought it might be a good choice to do this for the 2ff script. Not much had to be changed, because I was careful writing it, but still it won't hurt to but $TMP in double quotes.
2016-03-04Fix 2ffFRIGN
No idea how "xconvert" sneaked into there.
2016-01-05Fix 2ff stderr-redirectFRIGN
Thanks izabera for spotting this!
2016-01-052ff: Check return values and handle errorsFRIGN
Also, in case convert(1) is not in the path, it will just return an error-message giving the MIME-type of the problematic input data. The return-value is given properly as well (0 on success, 1 on error).
2015-12-11Use stdin and stdout with 2ffFRIGN
It always seemed odd to have a file-argument for 2ff, given all other farbfeld conversion tools operate on stdin and stdout only. Given I received numerous e-mails on this matter I've decided to change the usage to lessen the confusion. Maybe there's a way to do some magic with tee(1), but I didn't bother just yet. To ease the transition, the number of arguments are checked and a usage printed if arguments are given.
2015-11-23(Re)add jpg2ffFRIGN
Thanks z3bra for porting this! Also change 2ff to use case instead of if-blocks.
2015-11-17Add 2ff utilityFRIGN
This is a wrapper for the different conversion utilities with filetype detection using file(1) and an imagemagick fallback.