Commit Graph
20 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
boykopovar c3eba45600 fix(jpegdec): recover image metadata and coefficient requirements 2026-10-21 21:52:24 +03:00
Adrià 35fa2bdd82 Merge pull request #6555 from Ondra97/codex/fix-decoder-buffer-lifetime
fix(decoder): release decoded pixels when allocation fails
2026-10-20 10:41:19 +02:00
Federico Marras d65c969df8 feat(libSceJpegDec): decode with a down scale of 2, 4 or 8
sceJpegDecParseHeader and sceJpegDecDecode threw for every down scale
other than 1. SharpProspero's JpegDec.cs documents the factors 1, 2, 4
and 8 and output dimensions that account for the down scale.

Decoder::Jpeg gains DecodeScaled, which decodes through libjpeg-turbo's
scaled inverse DCT, and ScaledDimension, its rounded-up output size.
sceJpegDecParseHeader reports the scaled output size; sceJpegDecDecode
checks the pitch and image buffer against it, writes the scaled image
and packs the output size into its result. A down scale of 1 still
decodes as before. Decode modes other than 0, other down scales and a
down-scaled CMYK or YCCK image still throw.
2026-10-19 18:57:12 +02:00
Ondra97 20a3a38844 fix(decoder): release decoded pixels when allocation fails 2026-10-15 22:28:03 +02:00
mugurc 8ca4c10096 build(macos): configure the full build for x86-64 under Rosetta
The libraries are x86-64 code that runs under Rosetta 2 on Apple silicon,
so the full build selects x86-64 itself: CMAKE_OSX_ARCHITECTURES defaults to
x86_64, CMake is told the host processor is x86_64 instead of arm64, and
libjpeg-turbo, which is configured by its own CMake run, gets the same
values. Configuring the full build for another architecture fails with an
error.

Apple clang's libc++ needs -fexperimental-library for the C++20 library
features the sources use.

The prx libraries find each other through their run path. dyld does not
know $ORIGIN, so on macOS it is @loader_path.
2026-10-12 19:57:32 +03:00
hazzardouslysolid b5903e80da fix(png): bound transparency chunk detection to the input 2026-10-10 09:28:30 +08:00
Adrià FranchandClaude 263cb6626c feat(jpegenc): honor the encode restart interval
Co-Authored-By: Claude <[email protected]>
2026-10-06 14:16:07 +02:00
RomainROCH 12c229d19a fix(jpegenc): honor chroma sampling and encode true grayscale JPEGs 2026-10-05 21:49:36 +02: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
boykopovar 1cc9874ac1 Merge pull request #227 from adriadam10/feat/png-enc
feat(libScePngEnc): implement PNG encoding
2026-10-02 22:08:05 +03:00
Pouare514 8bd9670ab0 feat(libSceJpegDec): implement JPEG decoding 2026-10-02 13:34:41 +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
boykopovar a32715f71f refactor(cmake): require explicit runtime target for png and jpeg decoders 2026-10-01 12:38:06 +03:00
boykopovar 61ba4d661a refactor(cmake): place all test executables in build tests directory 2026-10-01 12:28:06 +03:00
Qznad 5853fec906 feat(decoder): add shared PNG encoder and decoder in core/Decoder/Png 2026-09-30 11:03:12 +01:00
Qznad 6ef4ae3cec fix(jpegenc): hide shared encoder symbols and document grayscale output 2026-09-29 15:17:27 +01:00
Qznad 94c7319202 feat(decoder): add shared JPEG encoder and decoder in core/Decoder/Jpeg 2026-09-29 15:17:27 +01:00