Skip to content

Fix: Corrupted DNG Exports due to Tile and Strip Metadata Conflict#30

Open
Leif-US wants to merge 1 commit intorymuelle:mainfrom
Leif-US:fix-dng-export
Open

Fix: Corrupted DNG Exports due to Tile and Strip Metadata Conflict#30
Leif-US wants to merge 1 commit intorymuelle:mainfrom
Leif-US:fix-dng-export

Conversation

@Leif-US
Copy link
Copy Markdown

@Leif-US Leif-US commented Apr 19, 2026

This commit resolves an issue where DNG files generated by RawRefinery could not be opened or appeared corrupted in various RAW converters (e.g., RawTherapee, ART, darktable) or image editors (e.g., Affinity Photo).

The root cause was a structural conflict in the DNG metadata: RawRefinery explicitly set 'TileWidth' and 'TileLength' tags, while the underlying 'pidng' library (in updated versions) expects and uses a 'Strip'-based image data layout. This inconsistency led DNG readers to fail in locating the actual image data.

The fix involves commenting out the 'TileWidth' and 'TileLength' tag assignments in 'dng_utils.py' to align RawRefinery's DNG writing with 'pidng's strip-based encoding. Additionally, EXIF metadata handling was made more robust to prevent crashes from missing tags.

This commit resolves an issue where DNG files generated by RawRefinery
could not be opened or appeared corrupted in various RAW converters
(e.g., RawTherapee, ART, darktable) or image editors (e.g., Affinity Photo).

The root cause was a structural conflict in the DNG metadata:
RawRefinery explicitly set 'TileWidth' and 'TileLength' tags,
while the underlying 'pidng' library (in updated versions) expects
and uses a 'Strip'-based image data layout. This inconsistency led
DNG readers to fail in locating the actual image data.

The fix involves commenting out the 'TileWidth' and 'TileLength' tag
assignments in 'dng_utils.py' to align RawRefinery's DNG writing
with 'pidng's strip-based encoding. Additionally, EXIF metadata
handling was made more robust to prevent crashes from missing tags.

This bug was diagnosed with AI assistance and the solution has been
tested and confirmed to resolve the issue.
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