AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2007.05.04 11:51 "[Tiff] TIFFSetField and float values", by mikk
2007.05.04 12:18 "Re: [Tiff] TIFFSetField and float values", by Andrey Kiselev
2007.05.04 12:46 "Re: [Tiff] TIFFSetField and float values", by mikk
2007.05.04 13:02 "Re: [Tiff] TIFFSetField and float values", by Joris Van Damme
2007.05.04 13:13 "Re: [Tiff] TIFFSetField and float values", by Toby Thain
2007.05.04 13:20 "Re: [Tiff] TIFFSetField and float values", by Joris Van Damme
2007.05.04 21:06 "[Tiff] TIFFSetField and float values", by mahmoudi wafa

2007.05.04 12:46 "Re: [Tiff] TIFFSetField and float values", by mikk

mikk napisał(a):

I'm fighting with saving TIFFTAG_XRESOLUTION and TIFFTAG_YRESOLUTION into a TIFF file.

AFAIK TIFFSetField is supposed to have 32 bit float as 3rd parameter

> and I pass such type of parameter to TIFFSetField [...] Oh, my, I've found the reason. Digging into the source code I realized that TIFFSetField

gets the parameter from va_arg as double:
(From tif_dir.c,v 1.72 2006/03/15 12:49:35, line 234:)
//...
case TIFFTAG_XRESOLUTION:
        td->td_xresolution = (float) va_arg(ap, double);
        break;
//...

When I pass argument of type double, the tag saves the value properly. Looks like an error in documentation (TIFFSetField.3tiff.html)?

Kind regards,

mikk