summaryrefslogtreecommitdiff
path: root/if2png.c
AgeCommit message (Collapse)Author
2014-07-29Revert "Fix endianness in header"sin
The previous behaviour was correct. A width of 1900 pixels which is 0x00000640 in hex was stored on disk as: 00 00 06 40 That's BE order which is what we want. Reading this uint32_t on an LE machine we get: width = 0x40060000 and converting from BE to LE we get the correct 0x640 value. Reading on a BE machine we get the correct value and the swap is a no-op.
2014-07-29Fix endianness in headerFRIGN
Well, who would have thought fwrite already converts your integer to NBO? It would've been bloody helpful to at least mention it in the manual. While at it, fix the wrong read-in-code and call it a day.
2014-07-29After reworking the code png_row doesn't need to be explicitly initializedsin
2014-07-29Don't bother to cleanup in error casessin
These tools are "one-shot", nobody cares about memory leaks while the program is running. Bring back -Os, no more false positives because there's no interaction between gotos and setjmp/longjmp.
2014-07-29Use %lu in case of an unexpected EOF or row-skewsin
We could use the macros from stdint.h but this should be good enough.
2014-07-29Reorder includessin
2014-07-29Ensure that png_row is NULLsin
If we fail early, the call to free(png_row) could crash because of an uninitialized (non-NULL) png_row.
2014-07-29If the match at the start of the header doesn't match say so explicitlysin
2014-07-29Fix type inconsistencies and remove hacky compiler optionssin
-Os generates lots of false positives and it is not worth it much for such a small set of tools.
2014-07-20Use if-extension and naming for imagefileFRIGN
Respectively, image.png will become an image.if