The patches and files are provided in the BugList as enhancement: (http://bugzilla.maptools.org/show_bug.cgi?id=2703)
Furthermore, additional enhancements and corrections are included:1) Data type of GPS_IFD and EXIF_IFD tags are corrected from TIFF_IFD8 to TIFF_LONG as of EXIF 2.31 specification. See also http://bugzilla.maptools.org/show_bug.cgi?id=25392) Writing and reading of rational values in custom fields is enhanced resulting in nearly double precision - standard LibTiff only has float precision. This feature can be enabled with #define RATIONAL2DOUBLE in tiffiop.h. However, if RATIONAL2DOUBLE is defined, parameter type for reading and writing TIFF_RATIONAL parameters using TIFFSetField() and TIFFGetField() have to be adapted to 'double' as defined in tif_dirinfo.c. The function IsRational2Double() indicates, if the library was compiled with this option.See also Rationals with true DOUBLE precision for CUSTOM defined tags (http://bugzilla.maptools.org/show_bug.cgi?id=2542)Attention:3) The "#define IGNORE 0" in tif_dirread.c collides with the GPS tag "VersionID=0"
and prevents the tag to be read. Therefore, the #define should be redefined
for example to "#define IGNORE 65534 //(-2)"4) FILESOURCE and SCENETYPE are defined as TIFF_UNDEFINED.
However, TiffLib does not read TIFF_UNDEFINED with field_readcount==1!
Therefore, they should be defined as TIFF_BYTE.Complete changed files regarding to LibTiff version 4.0.7 are attached: tiffiop.h; tif_dirwrite.c; tif_dirinfo.c; tif_dirread.c; tif_dir.c; tiff.h; tiffio.h; tif_dir.hFurthermore a patch file against version 4.0.7 is attached too: TiffLib-4.0.7_EXIF-231_.patchTwo example files for writing/reading EXIF and GPS tags are provided within the "test" directory. Because EXIF sub-directory functionality in LibTiff misuses the mechanism of multipage TIFF writing,damaged or incomplete directory-trunks are generated easily without intention.- custom_dir_EXIF_231.c- custom_dir_MultiPage_EXIF.cThey give some hints, how to read / write tags with the different types.This information is provided in the BugList as enhancement: (http://bugzilla.maptools.org/show_bug.cgi?id=2703)For application of custom directories refer to:"Custom and EXIF directory read/write", by Frank Warmerdam http://www.asmail.be/msg0055058657.html and"Creating private IFD", by http://www.asmail.be/msg0055095680.htmlRegardsSu