summaryrefslogtreecommitdiff
path: root/2ff
Commit message (Collapse)AuthorAge
* 2ff: $FORMAT is now called $MIMEParide Legovini2017-07-27
|
* Suggest using apt instead of apt-getParide Legovini2017-07-16
|
* Merge tag '3'Paride Legovini2017-07-16
|\
| * Don't suppress imagemagick and png2ff(1) warningsLaslo Hunhold2017-04-14
| | | | | | | | | | | | 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.
| * Refactor 2ff(1)Laslo Hunhold2017-04-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Patch 2ff script to suggest install imagemagickDmitry Bogatov2017-03-14
|/ | | | | | | | 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.
* 2ff: use trap to remove temporary fileFRIGN2016-09-19
| | | | This also frees us from having to store the return value somewhere.
* 2ff: make it more portableFRIGN2016-09-19
| | | | Thanks Roberto and Evan Gates!
* 2ff: Make it idempotent and clean it up a bitFRIGN2016-09-19
| | | | If a file begins with "farbfeld", we just pass it through.
* Shellcheck 2ff fixesFRIGN2016-09-07
| | | | | | | | 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.
* Fix 2ffFRIGN2016-03-04
| | | | No idea how "xconvert" sneaked into there.
* Fix 2ff stderr-redirectFRIGN2016-01-05
| | | | Thanks izabera for spotting this!
* 2ff: Check return values and handle errorsFRIGN2016-01-05
| | | | | | 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).
* Use stdin and stdout with 2ffFRIGN2015-12-11
| | | | | | | | | | | | 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.
* (Re)add jpg2ffFRIGN2015-11-23
| | | | | | Thanks z3bra for porting this! Also change 2ff to use case instead of if-blocks.
* Add 2ff utilityFRIGN2015-11-17
This is a wrapper for the different conversion utilities with filetype detection using file(1) and an imagemagick fallback.