2020.02.03 16:30 "[Tiff] Problem with 4.1.0 of libtiff.", by David C. Partridge

2020.02.04 19:51 "Re: [Tiff] Problem with 4.1.0 of libtiff.", by Su

For some hints about using the EXIF tags you can have a look at:

1.) A first example is in the Libtif  testcustom_dir.c  /*Module to handling of custom directories like EXIF. */

2.) A further example with some comments and given hints to read/write EXIF and the EXIF-GPS tags can be found in the following Merge Request on GitLab: https://gitlab.com/libtiff/libtiff/-/merge_requests/91 There it is in file testcustom_dir_EXF_231.c. At least that worked for me.

Regards
Su

> -----Ursprüngliche Nachricht-----
> Von: David C. Partridge
> Gesendet: Di. 04.02.2020 19:39
> An: tiff@lists.osgeo.org
> Betreff: Re: [Tiff] Problem with 4.1.0 of libtiff.

I played guessing games and tried

TIFFSetDirectory(m_tiff, 0);
TIFFReadDirectory(m_tiff);

but rapidly discovered that TIFFSetDirectory() actually calls TIFFReadDirectory() internally.

So just inserting a call to TIFFSetDirectory(m_tiff,0) after I'd finished reading the EXIF data put things back so that I could actually read the image data!

Yippee!

PS Is there any sort of tutorial that tells me this sort of stuff - I have so far found very little apart from "baby" examples that don't worry about the fact that they leave you out in the weeds somewhere.

To expand somewhat on that.

tif->tif_flags, tif->tif_diroff, and pretty much most of the structure at tif->tif-dir are changed when TIFFReadEXIFDirectory is called.

As TIFFScanlineSize uses e.g. tif-dir.imagewidth etc.. it won't exactly work after a call to TIFFReadEXIFDirectory, and I suspect a slew of other stuff may go pear shaped as well.

David

> -----Ursprüngliche Nachricht Ende-----