Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for tiled DNGs with mismatch between TileWidth/TileLength tags and LJPEG92 SOF width/height #362

Merged
merged 5 commits into from Nov 21, 2023

Conversation

cytrinox
Copy link
Contributor

fixes #354

@cytrinox cytrinox added bug Something isn't working enhancement New feature or request dng labels Nov 21, 2023
@cytrinox cytrinox added this to the 0.6.0 milestone Nov 21, 2023
@cytrinox cytrinox self-assigned this Nov 21, 2023
These array values must have a default of 1 and wrapping them
in a struct provides a clean solution to implement Default trait.
…Width and TileLength tags

RGGB bayer data can be encoded like:

RGRGRG
GBGBGB
RGRGRG
GBGBGB

For some LJPEG92 prediction modes, it would be more efficient to
store pixels in width*2 and height/2 images:

RGRGRGGBGBGB
RGRGRGGBGBGB

In both cases the sum of pixels are equal, but dimension differs.

This patch adds a fallback if dimension is not equal by first
decoding into temporary tile buffer and then copy line-by-line
into output tile position.

issue dnglab#354
@cytrinox cytrinox merged commit 1250c29 into dnglab:main Nov 21, 2023
11 checks passed
@cytrinox cytrinox deleted the fix_dng_wh_bug branch November 21, 2023 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dng enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panicking when reading dng file
1 participant