2021.01.08 16:11 "[Tiff] Upgrade a pre-BigTIFF binary that uses obsoleted API", by OnlineCop

TL;DR

Old source code uses an obsoleted interface (TIFFMergeFieldInfo) to read/write custom tags into a TIFF. What is the current interface that should be used instead? Is there documentation on how to use it?

==

We use a 3rd-party application to turn thousands of individual images into a large tiled BigTIFF image. It contains all our custom tags (geospatial data, shapefile metadata, etc.) that downstream processes require.

One of our downstream processes creates "mask.tif" from that image, by using an old binary that was compiled before BigTIFF was introduced. When the generated mask.tif file is large enough that it becomes a BigTIFF, the process fails.

The that pre-BigTIFF binary's source calls the TIFFMergeFieldInfo function, using a struct which has, in large bold letters in the header, "OBSOLETED INTERFACES... Don't use this stuff in your application..." above it: https://gitlab.com/libtiff/libtiff/-/blob/master/libtiff/tiffio.h#L540-557.

What is the current method for handling custom tags? Most of the documentation for customizing tags (such as http://www.simplesystems.org/libtiff/addingtags.html) still tells us to use this API.

@onlinecop