Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!mit-eddie!bloom-beacon!eru!hagbard!sunic!mcsun!corton!mirsa!zig.inria.fr!kjartan From: kjartan@zig.inria.fr (Kjartan Emilson) Newsgroups: comp.graphics Subject: TIFF & ImageMagick bug Keywords: TIFF,ImageMagick,bug Message-ID: <9209@mirsa.inria.fr> Date: 18 Nov 90 13:19:59 GMT Sender: news@mirsa.inria.fr Reply-To: kjartan@zig.inria.fr (Kjartan Emilson) Organization: INRIA, Sophia-Antipolis (Fr) Lines: 45 I guess that the following bugs are well known, and I am just stupid enough to get myself broken versions of these packages, but in principle these should have been from reliable sources, so I report them anyway, in case somebody has had the same p a i n trying to trace them out >:-( TIFF Bug: In the file tif_open.c, line 133 and line 196 we have: > if (!TIFFDefaultDirectory(tif)) > goto bad; But TIFFDefaultDirectory is not defined to return anything. On my Sparc it returns always 0 and to bad I went. Fix it by taking away the condition, or letting TIFFDefaultDirectory return TRUE. ImageMagick Bug: In the filter MIFFtoTIFF in the file MIFFtoTIFF.c at line 248, we have: >TIFFSetField(file,TIFFTAG_COLORMAP,c,c+image->colors,c+image->colors*2); This sets the COLORMAP field of the TIFF file, but the actual colormap entries are not defined until in the next 6 lines, so the TIFF file gets saved with a colormap with all zeros... Fix it by moving the above line down 6 lines, and change 'c' to 'colormap' in the argument list: > .. > .. > for (i=0 ; i < image->colors; i++) > *c++=image->colormap[i].blue << 8; > TIFFSetField(file,TIFFTAG_COLORMAP, > colormap,colormap+image->colors,colormap+image->colors*2); Hope this helps, -Kjartan ------------------------------------------------------------------------- Kjartan Pierre Emilsson Institut Non-lineaire de Nice-Sophia-Antipolis Parc Valrose Nice France