Skip to content

feat(libSceJxr): implement PKImageDecode query and metadata exports - #15684

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
ashwin280802:feat/jxr-image-decode-metadata
Nov 7, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
ashwin280802:feat/jxr-image-decode-metadata

Conversation

@ashwin280802

@ashwin280802 ashwin280802 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What

Implements the libSceJxr PKImageDecode query and lifetime exports (Initialize, GetPixelFormat, GetSize, GetResolution, GetFrameCount, GetColorContext, GetDescriptiveMetadata, Release) on jxrlib's own PKImageDecode, through src/NativeGlue.c, following JXRGlue.c L799-L905. The six getters call the jxrlib functions directly. Initialize and Release are line-for-line copies of the jxrlib bodies in NativeGlue.c, so that the guest GetPos and Close callbacks can be called with the guest ABI.

Deliberate divergences from jxrlib: a null decoder, null output, null Release argument, a stream without GetPos, and an owned stream that is missing or has no Close throw std::invalid_argument, where jxrlib would dereference them. Initialize sets 96 DPI, one frame and GUID_PKPixelFormatDontCare, and leaves the metadata block alone when GetPos fails, as jxrlib does. GetColorContext and GetDescriptiveMetadata return WMP_errNotYetImplemented for every input, as jxrlib never reads their arguments. The console's decoder layout is unverified; see docs/dev/debt/libSceJxr.md.

Open PRs touching the same libSceJxr files: #16402, #16403, #16404, #16405, #16406 and #16408 overlap in Export.cpp, Api.hpp and the debt file, and some also in GuestJxr.cpp, GlueHelpers.cpp, NativeGlue.c and CMakeLists.txt. None of them implements these eight exports (I read #16403, which implements PKImageDecode_Create and installs callbacks to the same jxrlib functions while its exports stay stubs; the others I judged from their titles). The overlap check could not compare these 35 PRs against the base: #7645, #14212, #15148, #15232, #15626, #15645, #15646, #15689, #15771, #15772, #15774, #16225, #16227, #16228, #16229, #16230, #16232, #16233, #16273, #16275, #16276, #16277, #16278, #16279, #16282, #16297, #16298, #16299, #16300, #16402, #16403, #16404, #16405, #16406, #16408. #16403 adds a similar set of native decode helpers under other names, so whichever of the two merges second has to reconcile them. Shared insertions need reconciling in merge order.

Tested

Windows 11, MinGW-w64 GCC 15.2.0, commit a0827f1.

$ ctest --test-dir build-full -R guest_jxr --output-on-failure
100% tests passed out of 13
$ python3 tools/check_conventions.py --base origin/main
All conventions checks passed.

I changed 13 conditions one at a time and the test failed on all 13.
Not covered by a test: nothing (0 survivors).
The full Linux suite also ran on the same code before the last rebase onto main, and every guest_jxr test passed; it was not re-run on the rebased commit.
Not verified: AddressSanitizer, any title or console behaviour.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Progress report (6c1efc7 → 454aae6)

📈 System libraries: 31.6% (+0.03%, +8 implemented functions)

✅ 8 implemented
Library Name
libSceJxr PKImageDecode_GetColorContext_nid_postfix
libSceJxr PKImageDecode_GetDescriptiveMetadata_nid_postfix
libSceJxr PKImageDecode_GetFrameCount_nid_postfix
libSceJxr PKImageDecode_GetPixelFormat_nid_postfix
libSceJxr PKImageDecode_GetResolution_nid_postfix
libSceJxr PKImageDecode_GetSize_nid_postfix
libSceJxr PKImageDecode_Initialize_nid_postfix
libSceJxr PKImageDecode_Release_nid_postfix

Changed libraries (implemented exports)

Library Before After Change
libSceJxr 60/136 (44.12%) 68/136 (50.00%) +5.88%

@B-Howell

B-Howell commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Hi, I prepared a tested ordinary-merge refresh on B-Howell/unstick/pr-15684, preserving your eight PKImageDecode exports and the landed JXR additions. It was qualified against main 55064c81; a fresh merge preview against current main e647fe1 is clean. Windows and WSL each passed guest_jxr, guest_jxr_stream, guest_jxr_glue, and guest_jxr_quantizer 3/3, plus public_headers 65/65.

@ashwin280802

Copy link
Copy Markdown
Contributor Author

Thanks @B-Howell! Rebased directly onto current main (\492ed5c5fe5), cleanly integrating the eight PKImageDecode exports with the landed post-proc tests in \GuestJxr.cpp, and confirmed all conventions checks pass.

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Nov 6, 2026
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 15626 core/libs/prx/libSceJxr/Export.cpp L296-329
core/libs/prx/libSceJxr/include/Api.hpp L98-107
docs/dev/debt/libSceJxr.md L47
PR 15645 docs/dev/debt/libSceJxr.md L47
PR 16696 docs/dev/debt/libSceJxr.md L47
PR 16698 docs/dev/debt/libSceJxr.md L47
PR 16699 docs/dev/debt/libSceJxr.md L47
PR 16700 docs/dev/debt/libSceJxr.md L47
PR 16701 docs/dev/debt/libSceJxr.md L47
PR 16702 docs/dev/debt/libSceJxr.md L47
PR 16704 docs/dev/debt/libSceJxr.md L47
PR 16705 core/libs/tests/GuestJxr.cpp L353
docs/dev/debt/libSceJxr.md L47
PR 16706 core/libs/prx/libSceJxr/CMakeLists.txt L53-54
core/libs/prx/libSceJxr/src/GlueHelpers.cpp L15, L80
core/libs/prx/libSceJxr/src/NativeGlue.c L2, L57
core/libs/tests/GuestJxr.cpp L353
docs/dev/debt/libSceJxr.md L47
PR 16707 core/libs/tests/GuestJxr.cpp L353
docs/dev/debt/libSceJxr.md L47
PR 16709 core/libs/tests/GuestJxr.cpp L353
docs/dev/debt/libSceJxr.md L47
PR 16710 docs/dev/debt/libSceJxr.md L47
PR 16711 docs/dev/debt/libSceJxr.md L47
PR 16712 core/libs/prx/libSceJxr/CMakeLists.txt L53-54
core/libs/prx/libSceJxr/src/GlueHelpers.cpp L15, L80
core/libs/prx/libSceJxr/src/NativeGlue.c L57
core/libs/tests/GuestJxr.cpp L353
docs/dev/debt/libSceJxr.md L47
PR 16713 core/libs/prx/libSceJxr/CMakeLists.txt L53-54
core/libs/prx/libSceJxr/src/GlueHelpers.cpp L15, L80
core/libs/prx/libSceJxr/src/NativeGlue.c L2, L57
core/libs/tests/GuestJxr.cpp L19, L353
docs/dev/debt/libSceJxr.md L47
PR 16714 core/libs/prx/libSceJxr/src/GlueHelpers.cpp L15, L80
core/libs/prx/libSceJxr/src/NativeGlue.c L2, L57
docs/dev/debt/libSceJxr.md L47
PR 16715 docs/dev/debt/libSceJxr.md L47
PR 16728 core/libs/tests/GuestJxr.cpp L353
docs/dev/debt/libSceJxr.md L47
PR 16729 core/libs/prx/libSceJxr/Export.cpp L292-327
core/libs/prx/libSceJxr/include/Api.hpp L97-105
core/libs/prx/libSceJxr/src/GlueHelpers.cpp L15, L80
core/libs/prx/libSceJxr/src/NativeGlue.c L2, L57
docs/dev/debt/libSceJxr.md L47
PR 16730 core/libs/prx/libSceJxr/src/NativeGlue.c L2
docs/dev/debt/libSceJxr.md L47
PR 16731 core/libs/prx/libSceJxr/src/GlueHelpers.cpp L15
core/libs/prx/libSceJxr/src/NativeGlue.c L2, L57
docs/dev/debt/libSceJxr.md L47
PR 16732 core/libs/prx/libSceJxr/include/Api.hpp L7
core/libs/prx/libSceJxr/src/GlueHelpers.cpp L15
core/libs/prx/libSceJxr/src/NativeGlue.c L2, L57
docs/dev/debt/libSceJxr.md L47
PR 16733 docs/dev/debt/libSceJxr.md L47
PR 16827 docs/dev/debt/libSceJxr.md L47
PR 16851 docs/dev/debt/libSceJxr.md L47
PR 16854 docs/dev/debt/libSceJxr.md L47

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 14212 docs/dev/debt/libSceJxr.md
PR 15646 core/libs/prx/libSceJxr/CMakeLists.txt
core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 15689 core/libs/prx/libSceJxr/CMakeLists.txt
core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16282 core/libs/prx/libSceJxr/CMakeLists.txt
core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md

@ashwin280802
ashwin280802 force-pushed the feat/jxr-image-decode-metadata branch from 9228021 to a0827f1 Compare November 7, 2026 07:49
@github-actions github-actions Bot added build needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Nov 7, 2026
@oneandonlydean oneandonlydean self-assigned this Nov 7, 2026
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ashwin280802
ashwin280802 force-pushed the feat/jxr-image-decode-metadata branch from a0827f1 to 454aae6 Compare November 7, 2026 15:25
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 7, 2026
@oneandonlydean
oneandonlydean merged commit 008147f into boykopovar:main Nov 7, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants