AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2005.06.07 20:52 "[Tiff] EXIF and PS Layer copy question", by Quart-EDV
2005.06.08 13:22 "[Tiff] Re: EXIF and PS Layer copy question", by Quart-EDV
2005.06.08 15:45 "Re: [Tiff] Re: EXIF and PS Layer copy question", by Bob Friesenhahn
2005.06.08 16:53 "Re: [Tiff] Re: EXIF and PS Layer copy question", by Quart-EDV
2005.06.08 17:00 "Re: [Tiff] Re: EXIF and PS Layer copy question", by Bob Friesenhahn
2005.06.09 19:43 "Re: [Tiff] Re: EXIF and PS Layer copy question", by Andrey Kiselev

2005.06.07 20:52 "[Tiff] EXIF and PS Layer copy question", by Quart-EDV

Hi,

I have a question on copying exif-tag (34665) and photoshop-layer-tag
(37724) with tiffcp, extended by the following code:

#define TIFFTAG_PS_LAYER        37724
#define TIFFTAG_EXIF_IFD        34665

static void TagExtender(TIFF *tiff)
{
     static const TIFFFieldInfo xtiffFieldInfo[] =
        {
         { TIFFTAG_PS_LAYER, TIFF_VARIABLE, TIFF_VARIABLE,
TIFF_UNDEFINED, FIELD_CUSTOM, 0, 1, "Photoshop_Layer" },
         { TIFFTAG_EXIF_IFD, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_LONG,
FIELD_CUSTOM, 0, 1, "EXIF_IFD" },
     };

     TIFFMergeFieldInfo( tiff, xtiffFieldInfo,
                         sizeof(xtiffFieldInfo) /
sizeof(xtiffFieldInfo[0]) );
}

int main (......)
{
        uint32 len32;
        void** data;

TIFFSetTagExtender(TagExtender);

/* leaving out TIFFOpen and the other stuff */

        if (TIFFGetField(in, TIFFTAG_PS_LAYER, &len32, &data))
                TIFFSetField(out, TIFFTAG_PS_LAYER, len32, data);

        if (TIFFGetField(in, TIFFTAG_EXIF_IFD, &len32, &data))
                TIFFSetField(out, TIFFTAG_EXIF_IFD, len32, data);

        /*..............*/
}

Maybe it is too late today... this code is not copying the tags right.
How do I copy them the right way.

Thanks! Best regard

jerry