AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2005.10.24 07:20 "[Tiff] How can I insert IFD at custom index?", by Шебеко Евгений
2005.10.24 20:02 "Re: [Tiff] How can I insert IFD at custom index?", by Andrey Kiselev
2005.10.24 20:16 "Re: [Tiff] How can I insert IFD at custom index?", by Andrey Kiselev
2005.10.25 06:53 "Re[2]: [Tiff] How can I insert IFD at custom index?", by Шебеко Евгений

2005.10.25 06:53 "Re[2]: [Tiff] How can I insert IFD at custom index?", by Шебеко Евгений

>> I need to insert IFD at a custom index.
>>
>> I see only function that insert IFD at the end of file.
>> Maybe it's possible some hack solution do do this?

You can write IFD either at the end of file (using usual method) or at the any position using the TIFFCheckpointDirectory() function. The IFD structure will be dumped out immediately whenever the TIFFCheckpointDirectory() will be called. See the attached sample code, it will create the TIFF file with the IFD in the middle of image (you can confirm that with binary viewer, just search for the DateTime tag contents).

Sorry, it my bad English ;). I really don't care where in the file my IFD will be located. But i need to insert IFD at custom index.

For example I have file with 6 IFD, and I need to insert new IFD at the index 3.

old file
0
1
2
3 <--- need to insert at this index
4
5
6

  updated file
  0 (0)
  1 (1)
  2 (2)
  3 (new directory)
  4 (3)
  5 (4)
  6 (5)
  7 (6)