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
Fix TileOffsets for DNGs containing one tile #6576
base: dev
Are you sure you want to change the base?
Conversation
4110225
to
e9996b5
Compare
At least this fixes the issues with decoding the file that I uploaded, but I'm not 100 % sure about what's happening... Let me know if you have any image files for regression testing. |
if (len == 1) | ||
tiff_ifd[ifd].tile_width = tiff_ifd[ifd].tile_length = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this will affect the logic here:
Lines 7065 to 7066 in 2ce5b82
if (!tile_width ) tile_width = INT_MAX; | |
if (!tile_length) tile_length = INT_MAX; |
...but I'm not sure why you would like to set
tile_width
/tile_length
to 0 or INT_MAX...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this breaks lossless JPEG decoding for some reason...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing
Lines 1136 to 1137 in 2ce5b82
if (tile_length < INT_MAX) | |
fseek (ifp, get4(), SEEK_SET); |
seems to solve the problem for lossless JPEG encoded single tiled DNGs, but will at the same break things for some multi-tiled images...
It might also be worth looking into the logic deciding between the two functions lossless_jpeg_load_raw
and lossless_dng_load_raw
.
The old code looks messed up, but I'm not sure... Fixes Beep6581#6575
e9996b5
to
1a28172
Compare
At least this image works again with the latest patch set. EDIT: This image is also fine. |
I must say, you're a brave man trying to disect and change |
Yes, we need to be really careful... I'm not even sure if this problem is related to the singled tiled nature of the image I uploaded or something else. At least I think this change will only affect images were |
Tagging this for 6.0 as it touches radioactive elements. Let's merge as soon as 5.10 is out to allow as much time for testing as possible. |
@SimonSegerblomRex can you provide a list of affected cameras? |
I actually don't know of any cameras affected by the bug that I tried to fix here, but a lot of cameras could potentially be affected by this change, so I would be really careful merging this without thorough regression testing. Maybe it's better to convert this pull request to draft. |
5.10 has just been released. Now is a good time to merge if this is ready for broader testing. |
The old code looks messed up.
Fixes #6575