
Thread
2000.06.28 11:55 "Problem with libtiff under Windows", by Jonathan Potter
Hi all, firstly please let me apologise if this is a FAQ, I have been unable to find an archive for this mailing list.
I am trying to get libtiff working under Windows (Win98 actually). It compiles fine and I can call it with seemingly no problems, but in use it seems unable to load some of the images in the test archive on the ftp.onshore.com site.
I am using libtiff 3.5.5 and the test archives come from the v3.4pics.tar.Z archive. I am using the basic TIFFReadRGBAImage() interface.
The test images that fail are:
jim___ah.tif - appears as random jumble of black and white squares
smalliz.tif - appears as a solid green square
zackthecat.tif - appears as a solid green square with a blue/black checkerboard pattern at the top
In addition to this, quad-jpeg.tif actually causes the program to crash (c0000005 error under Windows). The only way I have found to prevent it from crashing on this image is to change the following line at the top of the gtStripConfig function in tif_getimage.c:
buf = (u_char*) _TIFFmalloc(TIFFStripSize(tif));
It appears that this buffer is being overwritten; the strip size it is using is 10 lines but the crash occurs on line 5. I have therefore changed this line to:
buf = (u_char*) _TIFFmalloc(TIFFStripSize(tif)*2);
That fixes the crash, but the actual image that comes out is a solid black rectangle.
I haven't changed anything in the libtiff code (except for the above modification).
If anyone has any suggestions as to what could be causing these problems, I would be very grateful!
Cheers,
Jon
-- Jonathan Potter -- Left Side Software -- +61-414-721752 --
http://www.lss.com.au/