6.8.3-8: Error writing zero-length TIFF tags

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
rwruck
Posts: 7
Joined: 2011-11-09T10:55:59-07:00
Authentication code: 8675308

6.8.3-8: Error writing zero-length TIFF tags

Post by rwruck »

libtiff doesn't seem to like zero-length custom tags such as Photoshop or Microscope:

convert: ./123770.tif: Null count for "Photoshop" (type 1, writecount -3, passcount 1). `_TIFFVSetField' @ error/tiff.c/TIFFErrors/562.

Since this is a TIFFError, convert exits with a nonzero return code, although the file is written (maybe incomplete).
A zero-length tag doesn't make much sense here anyway, so could you please test whether the profile is empty before writing a 37724 or 34118 tag in TIFFSetProfiles?
Currently, I don't know whether this also applies to "standard" tags such as TIFFTAG_ICCPROFILE.
rwruck
Posts: 7
Joined: 2011-11-09T10:55:59-07:00
Authentication code: 8675308

Re: 6.8.3-8: Error writing zero-length TIFF tags

Post by rwruck »

This applies to any TIFF tag with variable length.

Here ist a simple EPS file that causes the error (0 byte 8bim profile) when converted to TIFF:

Code: Select all

%!PS-Adobe-2.0 EPSF-2.0
%%BoundingBox: 0 0 247 175
%%BeginSetup
%%EndSetup
%%EndComments
%%BeginProlog
28.346000 -28.346000 scale
-3.450000 -8.550000 translate
%%EndProlog
%BeginPhotoshop: 0
%EndPhotoshop
0.100000 setlinewidth
[] 0 setdash
0 setlinejoin
1.000000 1.000000 1.000000 setrgbcolor
newpath 3.500000 2.450000 moveto 3.500000 8.500000 lineto 12.100000 8.500000 lineto 12.100000 2.450000 lineto fill
0.000000 0.000000 0.000000 setrgbcolor
newpath 3.500000 2.450000 moveto 3.500000 8.500000 lineto 12.100000 8.500000 lineto 12.100000 2.450000 lineto closepath stroke
showpage
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: 6.8.3-8: Error writing zero-length TIFF tags

Post by magick »

We can reproduce the problem you posted and have a patch in ImageMagick 6.8.4-0 Beta available by sometime tomorrow. Thanks.
Post Reply