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

corrupted image metadata error on preview extraction of DNG image #1829

Closed
paolobenve opened this issue Aug 2, 2021 · 7 comments · Fixed by #1835
Closed

corrupted image metadata error on preview extraction of DNG image #1829

paolobenve opened this issue Aug 2, 2021 · 7 comments · Fixed by #1835
Labels
Milestone

Comments

@paolobenve
Copy link

I have the attached dng (I zipped it in order to get it accepted by the editor), I got it from a CR3 with Adobe DNG converter x64 13.3 IMG_7463.dng.zip

I get:

$ exiv2 -ep1 /home/paolo/raw/2021-08-02/IMG_7463.dng
Exiv2 exception in extract action for file /home/paolo/raw/2021-08-02/IMG_7463.dng:
corrupted image metadata

my exiv2 is 0.27.2, I'm on ubuntu 20.04

Since dng has been created by Adobe, it seems weird that their converter generate a corrupted image...

Is it an exiv2 bug? or is there any other reason why exiv2 sees this dng as corrupt?

@hassec hassec added the bug label Aug 3, 2021
hassec added a commit that referenced this issue Aug 3, 2021
hassec added a commit that referenced this issue Aug 3, 2021
@hassec hassec changed the title corrupted image metadata in dng image. Why? corrupted image metadata error on preview extraction of DNG image Aug 3, 2021
@hassec hassec added this to the v1.00 milestone Aug 3, 2021
hassec added a commit that referenced this issue Aug 3, 2021
@hassec
Copy link
Member

hassec commented Aug 3, 2021

Hi @paolobenve, thanks a lot for reporting this bug 👍

This was indeed a bug in exiv2 and not the DNG converter.
I've created #1835 to address this issue.
Once that is merged, please feel free to check out our nightly pre-release builds to benefit from these fixes as quickly as possible 😉

hassec added a commit that referenced this issue Aug 3, 2021
@paolobenve
Copy link
Author

Well, I'm wondering... I have been working with dng's for 3 years, all converted from CR3 coming from the same camera (Canon g5xm2), all converted with Adobe DNG converter...., and I never got this error...

The only difference from when I didn't got the error is that now I'm on a different pc, and I had to reinstall Adobe DNG Converter, perhaps I installed a different version? but dng is a standard, I cannot undestrand why the bug begun appearing now...

@hassec
Copy link
Member

hassec commented Aug 3, 2021

I'm also not sure, but if you look at the description of the pull request, there I go into a bit more detail about how a preview image can apparently be composed of one large chunk or multiple smaller ones.

The error was triggered in the code path handling a preview image with multiple smaller chunks.
But your image had 4 previews. The one we end up extracting actually belongs to the kind that only had one large chunk, but because all previews are first processed, we still ran into the error when processing one of the other three.

So it could just be that this different DNG Converter adds more previews to the DNG? or just changed the method of how it inserts these previews?
I'm really also out of my depth here, but that's one of the possible solutions.

hassec added a commit that referenced this issue Aug 3, 2021
mergify bot pushed a commit that referenced this issue Aug 3, 2021
… LoaderTiff::getData(), closes #1829

(cherry picked from commit 0fab606)
@paolobenve
Copy link
Author

in order to dive better inside the issue, I'm attacching a dng which doesn't produce the error:
Natale 2020-12-25--15.49.55.zip

It was generated with a (supposedly) previous version of Adobe DNG converter

hassec added a commit that referenced this issue Aug 4, 2021
… LoaderTiff::getData(), closes #1829

(cherry picked from commit 0fab606)
@hassec
Copy link
Member

hassec commented Aug 4, 2021

@paolobenve I've had a quick look at the 2nd picture and it has one less preview inside it and the previews that it does have, are all encoded in one large chunk.

I've no idea what exactly changed, but it seems to be that my first guess was right.
Something changed, and that meant that you are now hitting a different codepath inside exiv2 with your newer file which has a preview encoded in many small chunks.
Different camera firmware? Different DNG Converter version, or maybe just different settings? I've honestly no clue.

Lucky for us, as we were able to find this bug thanks to you 😉

@paolobenve
Copy link
Author

Different camera firmware?

no, same camera, same firmware

Different DNG Converter version

maybe

or maybe just different settings?

I tried different settings, the bug kept there

@hassec
Copy link
Member

hassec commented Aug 4, 2021

Not sure if more detective work is really worth it.
The resulting DNG you provided, is a perfectly valid DNG from what I can tell.
Exiv2 just unfortunately had a bug.

The fix has been merged, and will be available in the 0.27.5 release, which is planned for around September and it's already available via the nightly pre-releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants