Skip to content

Add macOS HEIC/HEIF import via the system codec - #1643

Open
reville wants to merge 1 commit into
CyberTimon:mainfrom
reville:codex/heic-import
Open

Add macOS HEIC/HEIF import via the system codec#1643
reville wants to merge 1 commit into
CyberTimon:mainfrom
reville:codex/heic-import

Conversation

@reville

@reville reville commented Aug 30, 2026

Copy link
Copy Markdown

Description

Adds macOS HEIC, HEIF, and HIF import support by decoding through Apple's ImageIO system codec. RapidRAW does not ship or statically link an HEVC decoder, avoiding the distribution concern blocking #964 and the bundled-FFmpeg approach explored in #1158.

The original image is never modified and no converted intermediate file is created. RapidRAW decodes into its in-memory RGB working representation; edits remain non-destructive in the normal .rrdata sidecar, and exporting a finalized image remains a separate action.

Related to #66. Alternative implementation to #964 and #1158.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Performance improvement
  • Code refactoring
  • Documentation update
  • UI/UX improvement
  • Build/CI or Dependency update

Changes Made

  • Adds a modular converted-input registry and macOS ImageIO HEIC/HEIF decoder.
  • Decodes into a 16-bit floating-point extended-sRGB working buffer with EXIF orientation handling, cancellation, and output-size limits.
  • Includes .heic, .heif, and .hif in root/synced folders, recursive discovery/counts, background indexing, file pickers, file associations, and drag-and-drop.
  • Shows one versioned disclosure before the first HEIC open:
    • “RapidRAW will decode HEIC using your system codec. No new file is created; the original remains unchanged.”
    • Primary action: “Open HEIC”
  • Persists the disclosure only after confirmation and localizes it across the existing 13 locales.
  • Advertises HEIC/HEIF/HIF only where a decoder is registered, currently macOS.

Screenshots/Videos

The disclosure modal was exercised locally through the file-open flow. Its complete user-facing copy is included above.

Testing

  • These changes were tested locally by a human and confirmed to work.
  • Automated tests were added for converted-input detection, folder discovery, disclosure behavior, safety limits, row order, and real system-codec decoding.

Test Configuration:

  • OS: macOS
  • Hardware: Apple Silicon

Checks run after rebasing onto current main:

  • cargo check --manifest-path src-tauri/Cargo.toml
  • cargo test --manifest-path src-tauri/Cargo.toml --lib — 8 passed, including a real HEIC encoded and decoded with the macOS system codec
  • npm run test:converted-input — 4 passed
  • npm run build
  • cargo fmt --manifest-path src-tauri/Cargo.toml -- --check

Repository-wide Clippy currently stops on an existing collapsible_if warning in src-tauri/src/exif_processing.rs, which is unchanged by this PR. The HEIC patch passed Clippy before rebasing onto the newer upstream commit that introduced that warning.

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

This intentionally starts with macOS because the OS-provided codec is the cleanest distribution model there. The registry and UI gating allow Windows or Linux system-backed decoders to be added independently later without changing the disclosure or import plumbing.

Cloud-sync placeholders may appear in the library before their bytes are downloaded. A zero-byte placeholder cannot be decoded until its provider hydrates it; this is separate from HEIF support.

HDR HEIC content is decoded into RapidRAW's current working color pipeline; exact HDR appearance remains bounded by the application's existing color-management behavior.

AI Disclaimer

  • This PR is created by an AI agent
  • This PR is mostly AI-generated but edited/merged together by a human
  • This PR was handwritten with AI assistance (spell check, logic suggestions, error resolving)
  • This PR contains only blood, sweat, and coffee (AI-free)

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