
Thread
2015.12.09 16:29 "Re: [Tiff] Creating private IFD", by Steve Underwood
A key problem with distributing an application that makes private IFDs is a standard install of libtiff doesn't install tif_dir.h
Steve
On 12/09/2015 11:52 PM, Mat Maher wrote:
>
> Hi all,
>
> Can anyone advise a ‘proper’ way to create private IFD’s within an
image TIFF?
I’ve been using the tif_dir.h routines: TIFFCreateCustomDirectory(), TIFFWriteCustomDirectory(); but a little concerned that, because I’m they need private header includes, this might not be the proper way to do things.
My current implementation does:
- Create TIFF file
> 2)Complete the ‘normal’ metadata
- Write the image data
- Create the custom IFD
- Write the IFD index into the normal tag area
- Close the file
> Unfortunately, it’s getting stumped at step (5), whereby I’m getting a
pair of exceptions:
> “Cannot modify tag “Compression” whilst writing”
>
> “Unknown tag 330”
-The first one is just bonkers, as neither writing data nor I’m modifying compression tags at the time
The second one relates to the TIFFTAG_SUBIFD tag write (step5): Which again is a little strange since this tag is defined by the library (so is not unknown).
Any help, suggestions or advice greatly appreciated!!