Repository navigation
feat(editor): warn when editing the embedded JPEG preview - #1966
Open
WilliamGiorno wants to merge 1 commit into
Open
WilliamGiorno wants to merge 1 commit into
WilliamGiorno wants to merge 1 commit into
Conversation
When RAW decoding fails, the loader falls back to the embedded JPEG preview without telling the user. load_image now reports used_embedded_preview (kept in the decoded image cache) and the editor toolbar shows a warning badge for that image. Closes CyberTimon#1873 Co-Authored-By: Claude Opus 5.5 <[email protected]>
WilliamGiorno
marked this pull request as ready for review
October 20, 2026 08:38
Contributor
|
also closes #1947 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When RAW decoding fails (decoder error or panic), RapidRAW silently falls back to the embedded JPEG preview and lets the user edit and export it, so users believe they are working on the RAW data. This PR surfaces that fallback in the editor.
Closes #1873
Type of Change
Changes Made
image_loader.rs: the base loader now also reports whether the embedded preview fallback was used. The flag is set only at the two fallback points (decoder error and decoder panic);load_base_image_from_byteskeeps its signature for all other callers (export, HDR, panorama, …).load_imagereturns a newused_embedded_previewfield; the flag is stored inDecodedImageCacheso it survives cache hits.Screenshots/Videos
With a RAW the decoder rejects, the toolbar shows the yellow "Embedded JPEG" badge next to the file name; hovering it shows the tooltip "Editing the embedded JPEG preview: RAW decoding failed". With the same file intact, no badge is shown.
Testing
Tested by hand with
npm starton a Panasonic RW2 truncated after its embedded JPEG (header and preview intact, sensor data cut), so the decoder fails and the fallback kicks in:cargo fmt --checkpasses;tsc,eslint,prettier --checkand the i18n checks report no new issues compared tomain.cargo clippy --all-targets --all-features -- -D warningspasses locally with the pinned 1.98 toolchain.Test Configuration:
Checklist
Additional Notes
Reproduce with any RAW the decoder rejects (e.g. a Nikon Z6 III NEF with HighEfficiency* compression, or a RAW file truncated after its embedded preview): the log shows "Using embedded preview fallback" and the badge appears in the editor toolbar.
AI Disclaimer:
Please state the involvement of AI in this PR: