Commit Graph
7 Commits
Author SHA1 Message Date
MarcZX10 12131a5c98 test(Decoder): require that a truncated tRNS PNG decodes to nothing
RequireTruncatedTransparency called Decode and ignored the result, so any
result passed. Assert that Decode returns no image for the input cut in the
middle of its tRNS chunk, which is what the decoder returns today.

Checked with a mutant Decode that returns an image for this input: the test
aborts on the mutant, and the previous version of the test passes it.
2026-10-31 21:49:04 +00:00
MarcZX10 8a7dbc18e6 test(Decoder): drop the self-comparison in the truncated tRNS test
RequireTruncatedTransparency compared the input buffer with a copy of
itself after calling Decode. Decode takes a read-only span, so that
comparison cannot fail and it tells the reader nothing. Remove it and
the copy it used. The decode call stays for now; the next commit makes
it an assertion.
2026-10-31 21:48:08 +00:00
Braxton Atkinson ada8c0b924 fix(png): mask low-bit grayscale transparency keys 2026-10-22 14:10:49 -05:00
hazzardouslysolid b5903e80da fix(png): bound transparency chunk detection to the input 2026-10-10 09:28:30 +08:00
DotDebianandClaude Opus 5.5 bfe9bf9af4 fix(pngenc): restrict adaptive filtering to the requested filter subset
A filter_type naming a subset of the PNG filters used only the first
filter of the mask, because stb's writer is either fully adaptive or
forced to one filter. Decoder::Png::Encode now takes the set of allowed
filter types, filters the rows and writes the chunks itself, and keeps
stb for deflate only. Output for the all-filters and single-filter
cases is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 02:08:31 +02:00
Adrià FranchandClaude 58f90eea9d feat(libScePngEnc): implement PNG encoding
scePngEncQueryMemorySize, scePngEncCreate, scePngEncEncode and
scePngEncDelete encode R8G8B8A8 and B8G8R8A8 images with a pitch into
RGB or RGBA PNGs using the shared encoder in core/Decoder/Png.
Decoder::Png::Encode takes optional compression level and filter
options so the encode parameters are honoured.

Co-Authored-By: Claude <[email protected]>
2026-10-02 10:00:32 +02:00
Qznad 5853fec906 feat(decoder): add shared PNG encoder and decoder in core/Decoder/Png 2026-09-30 11:03:12 +01:00