1999.10.04 08:24 "Problem with g4 fax decode", by Ian Marriott

Hello,

I am using libtiff 3.5.2 and compiling with Microsoft Visual C6 to a dos (box) program running on Windows NT. I am trying to decode G4 fax images where the whole image is in a single strip. My test program calls TIFFOpen, TIFFReadScanLine (x number of scan lines) and then TIFFClose. I then print the image which is 99% perfect but generates noise in places on the image, particularly where the image is not pure black but made up of dots. The printout looks odd because all the text on the page is perfect but pictures have noise around them!

Perhaps the way I compiled the library is the problem. I didnt use configure but just compiled the source with my own makefile.

The only code I changed was in tif_fax3.c I changed

  dsp->runs = (uint32*) _TIFFmalloc(nruns*sizeof (uint16));

to

  dsp->runs = (uint32*) _TIFFmalloc(nruns*sizeof (uint32));

because this buffer was being written to past the end.

I would be grateful to hear from anyone who has had similar experiences or can see where I am going wrong.

Thanks in advance

Ian Marriott