feat: read camera-embedded rating from RAW/EXIF & XMP - #1529
Conversation
Images the user never edited in RapidRAW had no rating (0) because the read path only looked at the .rrdata sidecar and XMP sidecars. Pull a rating from embedded XMP \xmp:Rating\ and the private EXIF Rating tag (0x4746) when .rrdata has none, so camera-assigned stars show up again. Closes CyberTimon#1130, CyberTimon#517
|
Can you remove the testing suite, remove all code comments and confirm it doesn't do any double reads etc? I haven't had time to test this properly, but I had many file double read scenarios while I tried to also implement this back then |
I’ve begun to deal with that |
|
Updated the branch (2ae8542, c035b79, cef0c7c): testing suite and all comments removed; the rating fallback now reuses the existing |
|
the existing EXIF read reused.
|
Images the user never edited in RapidRAW had no rating (0) because the read path only looked at the .rrdata sidecar and XMP sidecars. Pull a rating from embedded XMP \xmp:Rating\ and the private EXIF Rating tag (0x4746) when .rrdata has none, so camera-assigned stars show up again.
Closes #1130, #517
Description
Star ratings assigned in-camera (e.g. Lumix/Panasonic, Sony) were not shown in RapidRAW because the read path only looked at the
.rrdatasidecar (and an optional.xmpfile). For images never edited in RapidRAW the.rrdatahasrating: 0, and nothing ever pulled the camera's rating back in.This makes the read path fall back to the two interoperable carriers that cameras/other tools actually use: embedded XMP
xmp:Ratingand the private EXIFRatingtag (0x4746).Type of Change
Changes Made
src-tauri/src/exif_processing.rsread_image_rating(path, bytes): tries embedded XMPxmp:Rating(attribute and element forms) first, then the private EXIFRatingtag (0x4746).xmp:Rating-1(rejected) is treated as "not a star" (None), so a rejected photo never shows up as a 1-star.src-tauri/src/file_management.rsresolve_image_metadatanow, whenrating == 0, memory-maps the file and callsread_image_ratingto hydrate the rating for display..rrdatasidecar (avoids FEATURE: The side car file rrdata can be created only for images that is edited/loaded. #1514).Screenshots/Videos
Testing
Test Configuration:
Checklist
Additional Notes
Coverage depends on where each camera writes the rating (embedded XMP vs EXIF 0x4746). Reported #1130 (RW2) and #517 (Sony) are the targets; if a specific camera writes elsewhere (e.g.
RatingPercent0x4749), that can be a small follow-up once we have a sample.AI Disclaimer:
Please state the involvement of AI in this PR: