Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
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).
|
|
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.
|
|
|
|
|
|
|
|
use the proper multiplication factors :)
|
|
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
|