2015.12.09 15:52 "[Tiff] Creating private IFD", by Mat Maher

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


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:

  1. Create TIFF file

> 2)Complete the ‘normal’ metadata

  1. Write the image data
  2. Create the custom IFD
  3. Write the IFD index into the normal tag area
  4. 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!!