Skip to content

Add Leica-to-X2D and Leica-to-Fuji conversion pipelines#1

Open
smartfuse wants to merge 1 commit into
ThomasHMD:mainfrom
smartfuse:lucasyan/feature/leica-hasselblad-fuji-support
Open

Add Leica-to-X2D and Leica-to-Fuji conversion pipelines#1
smartfuse wants to merge 1 commit into
ThomasHMD:mainfrom
smartfuse:lucasyan/feature/leica-hasselblad-fuji-support

Conversation

@smartfuse
Copy link
Copy Markdown

@smartfuse smartfuse commented Apr 20, 2026

Summary

This PR adds Leica conversion support to 2FujiRaw.

New conversion paths:

  • Leica DNG -> Hasselblad X2D 3FR
  • Leica DNG -> Fuji GFX 100S II DNG via an intermediate X2D 3FR

It also keeps the existing Hasselblad X2D -> Fuji GFX 100S II workflow intact.

What changed

  • Added a native Swift Leica -> Hasselblad X2D writer
  • Added Leica -> Fuji conversion through the X2D intermediary pipeline
  • Added native TIFF parsing, Leica RAW extraction, metadata patching, and 3FR assembly code
  • Added a bundled stripped X2D header template so Leica conversions no longer require an external donor file in normal use
  • Updated the SwiftUI app to expose the new Leica mappings
  • Updated the CLI to support the new mappings and Leica-specific options
  • Updated build and packaging scripts to bundle the X2D template and handle bundled tool quarantine more reliably

Safety and robustness

This PR also hardens the new Leica pipeline by:

  • adding bounds checks for TIFF reads
  • rejecting malformed or oversized IFD structures
  • rejecting missing/zero RAW dimensions early
  • avoiding silent RAW row truncation
  • adding timeout protection to drag-and-drop file loading

Validation

Verified locally:

  • swift build succeeds
  • app bundle build succeeds
  • Leica DNG -> Hasselblad X2D CLI conversion succeeds
  • Leica DNG -> Fuji GFX 100S II CLI conversion succeeds

Notes

  • Leica -> Fuji is implemented as:
    • Leica DNG -> Hasselblad X2D 3FR
    • Hasselblad X2D 3FR -> Fuji GFX 100S II DNG
  • The bundled X2D template is a stripped header-only donor used to avoid requiring a full external donor file for normal Leica conversions.

Screenshots

Screenshot 2026-04-20 at 12 53 54 AM

Samples

Taken from a Leica SL2-S on a 24-90 lens at 90mm. All files imported into Lightroom with no edits except the profile selection.

Original Leica DNG rendered with Adobe Color

Leica-3

Converted Leica to Hasselblad rendered with Camera Standard

Leica-1

Converted Leica to Fuji rendered with Camera ETERNA/Cinema

Leica-2

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