You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
codecs: borrow EXIF when reading PSD and PSB headers - #4640
Select the last EXIF record by reference and use the resource IDs from the existing craft-psd pin. Full decode retains the last-record policy for ICC, EXIF and XMP, including its EXIF prefix and lossy XMP handling.
The new generated PSD and PSB regression checks duplicate resources, EXIF orientation and the full decode payloads. The codec suite passed 188 tests with one existing ignore before and after the change. Strict all-target codec Clippy, WebAssembly and workspace formatting passed on Windows with 16 Cargo jobs and test threads.
Summary by CodeRabbit
Bug Fixes
PSD decoding and header reading now consistently use the last available ICC, EXIF, and XMP metadata resources when duplicates are present.
No actionable comments were generated in the recent review.
Walkthrough
PSD decoding now selects the last matching ICC, EXIF, and XMP resources. Header orientation uses the last EXIF resource. Tests cover duplicate metadata resources in PSD and PSB inputs.
Changes: PSD metadata resource selection
Layer / File(s)
Summary
Resource lookup and metadata handling crates/codecs/src/psd.rs
New helpers select the last matching resource. Decoding uses the last ICC, EXIF, and XMP records, while header orientation uses the last EXIF record. Tests check duplicate resources for PSD and PSB, including EXIF prefix stripping and XMP conversion and trimming.
storytold/lightcraft#4167: Moves PSD resource reading into craft_psd::Head; this change updates how the codec reads the last EXIF record.
storytold/lightcraft#4602: Changes how the PSD codec obtains resource data from craft_psd in the same code path.
Suggested reviewers:dylanmtaylor, fredapps
Merge Risk: Minimal · up to 02820
PSD and PSB decoding and header orientation now consistently use the last metadata resource, and tests cover duplicate resources. No actionable merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title 'codecs: borrow EXIF when reading PSD and PSB headers' matches the main change. The PR changes PSD and PSB header orientation to read the last EXIF resource through borrowing via craft_psd::…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title 'codecs: borrow EXIF when reading PSD and PSB headers' matches the main change. The PR changes PSD and PSB header orientation to read the last EXIF resource through borrowing via craft_psd::ImageResource, and adds regression tests for duplicate metadata resources and EXIF orientation. The title is concise, specific, and states the primary change without a file list or vague terms.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between 1a81a5a and 028206f.
Files selected for processing: 1
crates/codecs/src/psd.rs
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
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
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.
LightCraft reads PSD and PSB header orientation without copying unrelated profile and XMP payloads.
Part of storytold/craft-libs#778 and storytold/craft-libs#786. Claim.
Select the last EXIF record by reference and use the resource IDs from the existing craft-psd pin. Full decode retains the last-record policy for ICC, EXIF and XMP, including its EXIF prefix and lossy XMP handling.
The new generated PSD and PSB regression checks duplicate resources, EXIF orientation and the full decode payloads. The codec suite passed 188 tests with one existing ignore before and after the change. Strict all-target codec Clippy, WebAssembly and workspace formatting passed on Windows with 16 Cargo jobs and test threads.
Summary by CodeRabbit