Opened 15 years ago
Closed 15 years ago
#1144 closed Patches (fixed)
GIL 2.1 PNG IO fix for endianness problem with bit_depth == 16.
Reported by: | Owned by: | ||
---|---|---|---|
Milestone: | To Be Determined | Component: | None |
Version: | Boost 1.34.0 | Severity: | Problem |
Keywords: | GIL | Cc: |
Description
When loading or saving PNGs with bit depth 16 on a little endian architecture, the bytes in each channel were not being swapped to match PNG's big endian byte ordering. This patch switches this byte-swapping on in LibPNG when loading and saving PNGs of bit-depth 16 on a little-endian architecture.
Patch is against GIL 2.1 release, but I submit it here rather than in the GIL sourceforge, since I gather GIL is now in Boost, as of the next Boost release! Let me know if this is not the right place for this patch. I note that there is no GIL component in this Trac yet, so I left that set to none.
Attachments (1)
Change History (5)
by , 15 years ago
Attachment: | gilPngEndian.patch added |
---|
follow-up: 3 comment:2 by , 15 years ago
Yes, with a run-time rather than compile-time check ... fair enough.
comment:3 by , 15 years ago
Run-time detection is better in this case:
- an extra check is a not performance issue at all here.
- run-time detection can work on architectures that can change endian-ness on the fly.
Swap bytes when doing bit-depth 16 PNG IO on little-endian architectures.