summaryrefslogtreecommitdiff
path: root/ff2ppm.c
Commit message (Collapse)AuthorAge
* Improve readability of alpha-blending sectionsLaslo Hunhold2017-04-14
|
* Update usage of ff2jpg(1) and ff2ppm(1)Laslo Hunhold2017-04-14
| | | | so they align with the manpages.
* Use fshut() to properly flush the output streamLaslo Hunhold2017-04-13
| | | | | | | | For small images, it could happen that the output stream would not be flushed before exit(), resulting in a lack of error-reporting on a full device. Using fflush(), a function I first introduced in sbase, we do the flushing before returning manually and report errors if they occurred.
* Refactor ff2ppm(1)Laslo Hunhold2017-04-12
| | | | | We make use of the utility functions for parsing the color mask and other things and generally align the code with the general coding style.
* Add util.{c|h} to deduplicate codeLaslo Hunhold2017-03-30
|
* Improve fread error handling in ff2*Alexander Krotov2016-05-19
| | | | | | In case of unexpected end of file errno is not set, and strerror(errno) returns "Success". Caller should distinguish between error and EOF by calling ferror(3) as described in fread(3).
* Remove dimension checksFRIGN2016-04-10
| | | | | | | | | | | | | | | | This may come as a surprise, but I'd like the libraries to handle these cases. Maybe some day libpng supports 0x0 images, so why impose artificial limits here? Same with ppm. For me, an ideal data converter loses as little information as possible. In mixed cases (dimensions 0xn, where n > 0) we could print a warning, but here, 2 principles come at play: - GIGO (garbage in, garbage out) - no information loss if possible Given the code later on won't try to access the malloc(0) region, we are also all safe.
* fix bugs introduced by refactor f0a4ce113d0e9dc50110a0ad9e98433d05aa2307Hiltjo Posthuma2016-04-03
|
* Use uint8_t instead of uint16_t correctlyFRIGN2016-03-21
|
* Write a better format for the row-buffer allocationFRIGN2016-03-21
|
* Optimize ff2ppm(1)FRIGN2016-03-21
| | | | use the proper multiplication factors :)
* add ff2ppm(1)Hiltjo Posthuma2016-03-21
ff2ppm can convert farbfeld images to PPM (P6 binary format, 24-bit RGB). ff2ppm has an option -b to set the background color, for example for png files: png2ff < test.png | ff2ppm -b '#00ff00' > test.ppm