2007.02.01 15:46 "Re: [Tiff] Interpreting SubIFDs tag", by Phil Harvey
Thanks Ed. You are correct. A linked list of SubIFD's appears to be how the tag was intended to be used. I have also located a sample TIFF image which uses this technique.
AUGGGGGHHHHHHHH!!!!!! (can you tell I'm frustrated)
Now I have another fairly complex patch that needs to be added to my TIFF writing software.
I am really growing to hate the TIFF format.
The problem is that my software also supports re-writing RAW images, some of which are TIFF-based and can be virtually indistinguishable from TIFF images, and my software has to work for all of them.
In all of my TIFF-based RAW image samples, multiple SubIFD's are referenced by a multiple values of the SubIFD tag (ie. a count of > 1), and not by chaining via the "next IFD" pointer. I have taken a close look at my RAW samples, and in some of them the SubIFD "next IFD" pointer is non-zero but doesn't point to a valid IFD. I have isolated the source of these images, and it appears that NEF images edited by Nikon Capture have this "feature".
So if I honour the SubIFD "next IFD" pointers, I must put in additional logic to validate the linked IFD to avoid problems with images such as the ones written by Nikon Capture. This sort of validation is difficult to do reliably.
Yet another patch applied to my already much-too-complex TIFF module. Oh well.