tiffcp - skipped tags

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

tiffcp - skipped tags

Jochen Barth
Dear list members,

when using tiffcp to decompress lzw-tiffs,
the tags
TIFFTAG_XMLPACKET,
TIFFTAG_RICHTIFFIPTC,
TIFFTAG_PHOTOSHOP
and
TIFFTAG_EXIFIFD (including contents of EXIFIFD)
are not copied.

For the first 3 ones I've added this lines to tools/tiffcp.c:
diff -r b39624c02bfb -r 72eecadbc278 tools/tiffcp.c
--- a/tools/tiffcp.c    Wed Sep 21 13:20:13 2016 +0200
+++ b/tools/tiffcp.c    Wed Sep 21 15:03:02 2016 +0200
@@ -767,6 +767,30 @@
        {
                uint32 len32;
                void** data;
+               if (TIFFGetField(in, TIFFTAG_XMLPACKET, &len32, &data))
+                       TIFFSetField(out, TIFFTAG_XMLPACKET, len32, data);
+       }
+       {
+               uint32 len32;
+               void** data;
+               if (TIFFGetField(in, TIFFTAG_RICHTIFFIPTC, &len32, &data))
+                       TIFFSetField(out, TIFFTAG_RICHTIFFIPTC, len32, data);
+       }
+       {
+               uint32 len32;
+               void** data;
+               if (TIFFGetField(in, TIFFTAG_PHOTOSHOP, &len32, &data))
+                       TIFFSetField(out, TIFFTAG_PHOTOSHOP, len32, data);
+       }
+       {
+               uint32 len32;
+               void** data;
                if (TIFFGetField(in, TIFFTAG_ICCPROFILE, &len32, &data))
                        TIFFSetField(out, TIFFTAG_ICCPROFILE, len32, data);
        }

Is this something which could be added to tiffcp permanently?

Kind regards,
Jochen

-- 
J. Barth * IT, Universitaetsbibliothek Heidelberg * 06221 / 54-2580

_______________________________________________
Tiff mailing list: [hidden email]
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Reply | Threaded
Open this post in threaded view
|

Re: tiffcp - skipped tags

Bob Friesenhahn
On Thu, 22 Sep 2016, Jochen Barth wrote:
>
> Is this something which could be added to tiffcp permanently?

I think that there would need to be tiffcp options to select what
metadata to transfer and that the default should be what it is
currently in order to not cause harm to existing processing.

Metadata is sometimes tied to pixel content and it is possible that
using tiffcp might cause some transformation which invalidates part of
the metadata.

Bob
--
Bob Friesenhahn
[hidden email], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
_______________________________________________
Tiff mailing list: [hidden email]
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/