Skip to content

Move JP2 format detection to wrapper.c#4

Merged
keiji merged 1 commit intomainfrom
feature/move-format-detection-to-wrapper-2809513954819770074
Jan 1, 2026
Merged

Move JP2 format detection to wrapper.c#4
keiji merged 1 commit intomainfrom
feature/move-format-detection-to-wrapper-2809513954819770074

Conversation

@google-labs-jules
Copy link
Contributor

Moved the logic for distinguishing between JP2 and RAW data formats based on the header from the Kotlin code to wrapper.c. Added a decode function in wrapper.c that checks the header and calls the appropriate internal decoding function. Updated Jp2kDecoder.kt to use this new function via the WASM export.


PR created automatically by Jules for task 2809513954819770074 started by @keiji

Refactor the JPEG2000 format detection logic by moving it from the Kotlin/JavaScript layer to the native C wrapper.

- `wrapper.c`: Add `decode` function that inspects the header to distinguish between JP2 and J2K (Raw) formats.
- `Jp2kDecoder.kt`: Remove `isJp2` logic and update the JavaScript bridge to call `exports.decode`.

Note: `openjpeg_core.wasm` needs to be rebuilt with the new `decode` function exported. The EXPORTED_FUNCTIONS list in the build command should now include `_decode`.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@keiji keiji marked this pull request as ready for review January 1, 2026 08:47
@keiji keiji merged commit 58766a0 into main Jan 1, 2026
@keiji keiji deleted the feature/move-format-detection-to-wrapper-2809513954819770074 branch January 2, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments