AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2017.10.10 05:43 "[Tiff] Memory management of Image", by Bhaskar Reddy
2017.10.10 11:54 "Re: [Tiff] Memory management of Image", by Kemp Watson
2017.10.10 13:02 "Re: [Tiff] Memory management of Image", by Bhaskar Reddy
2017.10.10 12:05 "Re: [Tiff] Memory management of Image", by Phil Harvey
2017.10.10 13:06 "Re: [Tiff] Memory management of Image", by Bhaskar Reddy
2017.10.13 00:48 "Re: [Tiff] Memory management of Image", by Kemp Watson
2017.10.13 01:41 "Re: [Tiff] Memory management of Image", by Bhaskar Reddy
2017.10.17 00:15 "Re: [Tiff] Memory management of Image", by Kemp Watson
2017.10.17 21:07 "Re: [Tiff] Memory management of Image", by Bhaskar Reddy
2017.10.22 16:59 "Re: [Tiff] Memory management of Image", by
2017.10.23 03:24 "Re: [Tiff] Memory management of Image", by Bhaskar Reddy

2017.10.23 03:24 "Re: [Tiff] Memory management of Image", by Bhaskar Reddy

Thanks a lot!

Very useful information.

I will get back to you with my questions when adding tags.

Thanks,
Bhaskar.

On Oct 22, 2017 11:59, <sulau@freenet.de> wrote:

Dear Bhaskar,

there are two ways to add additional, user defined or custom tags to the TIFF library:

a.) Patch the libtiff and compile your own, private libtiff version.

b.) Keep the official libtiff and add the custom tags from your own code by a feature of libtiff, which allows to define new custom directories with your own tags and handle them with libtiff functions.

----- For a.): -----
Look into the libtiff files

That’s it.

However, tag definition and correct usage of TIFFSetField() and TIFFGetField() is also not easy, because some unwritten rules apply.

For custom tags, the LibTiff TiffSetField() and TiffGetField() functions are using va_arg() lists. Thus, there won’t be a compiler error, if the wrong parameter type is used.

Note the "variable promotion" of va_arg() lists:

If an argument has not been declared, the compiler doesn’t have any information needed to perform standard type checking and type conversion for it. Since use of ellipsis doesn’t impose type safety which is one of the major goals of C++, it is sometimes considered a bad programming practice. But at times, you may need to use variable argument function particularly dealing with old C style functions. Different conversions are applied to functions declared with ellipses than to those functions for which the formal and actual argument types are known