Skip to content

feat: import Lightroom XMP sidecars - #1465

Open
dimafa wants to merge 5 commits into
CyberTimon:mainfrom
dimafa:codex/feat/lightroom-xmp-import
Open

feat: import Lightroom XMP sidecars#1465
dimafa wants to merge 5 commits into
CyberTimon:mainfrom
dimafa:codex/feat/lightroom-xmp-import

Conversation

@dimafa

@dimafa dimafa commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Description

Improve Lightroom and Camera Raw XMP migration into RapidRAW's non-destructive .rrdata workflow, including image-aware conversion for rendered JPEGs and corrected crop/white-balance handling for RAW files.

This supersedes #1280 and is rebuilt on current main. Thank you to @StephenMasseur for the original implementation and for agreeing to continue the work in a new PR.

The original image and XMP sidecar remain unchanged.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • UI/UX improvement

Changes Made

  • Import XMP adjustments for an individual image from the editor or library context menu.
  • Automatically discover a same-name .xmp sidecar next to the image, with a file-picker fallback.
  • Recursively import matching image/XMP pairs from a folder tree.
  • Support both attribute-based and element-based XMP values.
  • Import current Process Version 2012 adjustments and legacy Lightroom process-version fallbacks.
  • Import crop, crop rotation, and EXIF-orientation-aware crop coordinates.
  • Recover crop dimensions from the source image when the XMP omits TIFF/EXIF dimensions.
  • Convert Lightroom rotated crop corners into RapidRAW's post-rotation crop geometry.
  • Detect Adobe AlreadyApplied metadata so baked rendered-image adjustments are not imported twice.
  • Keep Lightroom "As Shot" white balance neutral in RapidRAW.
  • Convert custom RAW white balance relative to the camera's as-shot baseline when that baseline is available.
  • Ignore unsupported/ambiguous absolute white-balance values instead of guessing profile-dependent values.
  • Apply calibrated PV2012 and legacy PV5 response mappings to rendered JPEG imports.
  • Calibrate JPEG exposure, brightness, contrast, blacks, clarity, saturation, vibrance, hue, and their measured interactions.
  • Preserve the existing conservative RAW PV2012 mappings; rendered-JPEG calibration is selected only by the image-aware sidecar path.
  • Import supported tone curves, HSL, grayscale mixer, color grading, detail, noise reduction, vignette, grain, and basic adjustments.
  • Import rating, color-label, and keyword metadata.
  • Refresh affected thumbnails and active editor/library state after import.
  • Show immediate background-import feedback and live progress.
  • Provide a copyable report listing files with no supported changes and files that failed, including error details.
  • Prevent adjustment attributes in nested Lightroom profile/look descriptions from overwriting the image's active settings.
  • Add localized UI strings and document the import workflows in the README.

Screenshots/Videos

Folder context-menu import action

folderMenu

Import-in-progress indicator

statusMessage

Completed import and unchanged/failed-file report

report

Testing

  • These changes were tested locally by a human and confirmed to work.

Test Configuration:

  • OS: macOS 26.4
  • Hardware: Apple M5 Pro
  • Files: Representative JPEG, Sony ARW, Canon CR2, and DNG Lightroom edits across landscapes, people, high dynamic range, indoor color, and low light
  • Manual coverage:
    • Individual image automatic sidecar discovery
    • Recursive import across a folder containing approximately 1,733 matching sidecars
    • Missing-dimension crop fallback
    • Rotated and EXIF-oriented crops
    • Current and legacy process versions
    • As-shot and custom white-balance behavior
    • Rendered-JPEG calibration across representative adjustment combinations
    • Immediate progress feedback
    • Unchanged and failed-file reporting
    • Visual comparison in Lightroom and RapidRAW

Validation:

  • cargo test --manifest-path src-tauri/Cargo.toml --lib: 41 passed
  • cargo check --manifest-path src-tauri/Cargo.toml: passed
  • cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings: passed
  • cargo fmt --manifest-path src-tauri/Cargo.toml -- --check: passed
  • npm run build: passed
  • git diff --check: passed
  • Repository-wide TypeScript, ESLint, Prettier, and i18n extraction checks still report failures reproducible on current upstream main; no new frontend files are changed by the calibration update.

Checklist

  • My code follows the project's code style
  • I haven't added unnecessary AI-generated code comments
  • My changes generate no new warnings or errors

Additional Notes

Lightroom and RapidRAW use different camera profiles, control scales, tone curves, processing order, and tone-mapping algorithms. The calibrated conversion improves the initial imported appearance for measured rendered-JPEG cases without claiming pixel-identical rendering.

AI Disclaimer:

Please state the involvement of AI in this PR:

  • This PR was handwritten with AI assistance (spell check, logic suggestions, error resolving)

@dimafa
dimafa marked this pull request as ready for review August 3, 2026 14:12
@dimafa
dimafa requested a review from CyberTimon as a code owner August 3, 2026 14:12
@dimafa

dimafa commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Calibration and validation update: Further testing led to an image-aware conversion strategy rather than applying one mapping to every source. RAW imports retain the conservative XMP mappings, while rendered JPEGs now use measured nonlinear mappings for Lightroom PV2012 and legacy PV5 controls. The calibrated JPEG mappings cover exposure, brightness, contrast, blacks, clarity, saturation, vibrance, hue, and relevant control interactions.
This update also fixes several migration issues discovered during representative-library testing:

  • Rotated Lightroom crops are converted into RapidRAW’s post-rotation crop geometry.
  • Missing crop dimensions are recovered from the source image, including RAW active-area metadata and orientation.
  • Adobe AlreadyApplied metadata prevents baked adjustments from being applied twice.
  • “As Shot” white balance remains neutral, while supported custom RAW white balance is converted relative to the camera baseline.
  • Ambiguous profile-dependent white-balance values are ignored instead of being guessed.
  • Legacy JPEG brightness no longer makes common Brightness=0 images nearly black.
  • Nested Lightroom profile/look metadata can no longer overwrite the image’s active adjustments.

The implementation was manually validated with representative JPEG, ARW, CR2, and DNG images covering landscapes, people, high dynamic range, indoor color, and low light. The automated Rust suite now contains 41 passing tests, and recursive import was also tested on approximately 1,733 matching sidecars.
PR #1466’s genuine 16-bit TIFF export was useful during calibration, but it is not a dependency of this PR. Reference-image appearance matching is also intentionally separate from #1465

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