Skip to content

Read/write 16-bpc PNG data in native endian

M. Stoeckl requested to merge mstoeckl/cairo:fix-png-write-endian into master

This fixes #501 (closed) , and also ensures that 16-byte per channel formats can be read properly.

Documentation for png_set_swap: https://refspecs.linuxbase.org/LSB_3.1.0/LSB-Desktop-generic/LSB-Desktop-generic/libpng12.png.set.swap.1.html

I've tested this on a little-endian system so far, with the following code, that generates several pictures which should look identical: cairosavepng.c Edit: running the test program on a big-endian system under QEMU produces output files which are binary-identical to the ones made under little-endian.

Edited by M. Stoeckl

Merge request reports