Problems when converting TIFF files that contain tag 37724
Posted: 2011-11-09T11:17:14-07:00
Hi,
there seems to be a problem when converting TIFF files when the source contains the Photoshop ImageSourceData tag (37724).
I've used a command line like this (IM 6.7.2.0) to compress a TIFF file:
Reading the input file shows the usual warnings:
That's not a problem so far, but when writing the output file, there are errors:
The output file is written BUT it does not contain the 37724 tag AND convert exits with code 1 which indicates a failure.
Looking at tiff.c, there's the following code which seems to be intended for handling this tag:
This does not work, because 37724 is a custom tag. You'd have to register it using TIFFSetTagExtender as outlined here: http://www.asmail.be/msg0054585832.html
I'd assume that the declaration of the ImageSourceData tag would be something like
there seems to be a problem when converting TIFF files when the source contains the Photoshop ImageSourceData tag (37724).
I've used a command line like this (IM 6.7.2.0) to compress a TIFF file:
Code: Select all
convert -compress JPEG source.tif destination.tif
Code: Select all
source.tif: unknown field with tag 37724 (0x935c) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/707
Code: Select all
destination.tif: Unknown tag 37724. `TIFFSetField' @ error/tiff.c/TIFFErrors/497
Looking at tiff.c, there's the following code which seems to be intended for handling this tag:
Code: Select all
if (LocaleCompare(name,"tiff:37724") == 0)
(void) TIFFSetField(tiff,37724,(uint32)GetStringInfoLength(profile),
GetStringInfoDatum(profile));
I'd assume that the declaration of the ImageSourceData tag would be something like
Code: Select all
{ 37724, -1, -1, TIFF_UNKNOWN, FIELD_CUSTOM, 1, 1, "ImageSourceData" }