Bad IFD1 directory but there is only IFD0

Started by nickspiker, October 23, 2022, 10:48:00 PM

Previous topic - Next topic

nickspiker

Checking the validity of a .dng writer I'm working on and I tried to check as much as I could but I still can't figure out what's triggering this:
[ExifTool] - Warning : Bad IFD1 directory

Here's a link to the dng if you want to take a look:
https://mega.nz/file/ehBwzJ7S#2raYjJNqrk2uOdQfC0DYvmYAjSK4jcz4EDJHnwKlZn8

And is there a command I can put into exiftool to get more detail about warnings like this?

StarGeek

You can use this to see all the warnings and problems
exiftool -g1 -a -s -warning -validate badifd.dng

You can add -v3 (-verbose3) option to get a breakdown of the structure.  The -htmlDump option will give you an interactive HTML file.  See this post for examples.

Phil will probably have to look at it closer but odds are that the IFD1 is mangled such that exiftool can't find any data.  Or maybe there's the start of an IFD1 but nothing else.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

nickspiker

Yup.  That pretty much tells me what I need to know.
Thank you!

Phil Harvey

You forgot to write an IFD1 pointer at the end of IFD0.  If there is no IFD1, then you should write four zero bytes immediately after the last IFD0 directory entry.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

nickspiker


nickspiker

Now I just have minor warnings:
[minor] Odd offset for IFD0 tag 0x011a XResolution
but the tiff spec says to align with word boundaries which I don't understand because word lengths are dependent on the architecture, unless judging by your output, do they actually mean even numbered offsets?

Phil Harvey

"Word" boundary means 2-byte boundary (yes, offsets must be even)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).