AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
February 2009

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2009.02.13 03:24 "TIFFReadRGBAImage w/ 8bit-gray + aplha", by Chris Losinger
2009.02.13 08:50 "Re: TIFFReadRGBAImage w/ 8bit-gray + aplha", by Joris Van Damme
2009.02.13 17:36 "Re: TIFFReadRGBAImage w/ 8bit-gray + aplha", by Bob Friesenhahn
2009.02.13 21:34 "Re: TIFFReadRGBAImage w/ 8bit-gray + aplha", by Frank Warmerdam

2009.02.13 03:24 "TIFFReadRGBAImage w/ 8bit-gray + aplha", by Chris Losinger

	i have a TIFF: 8-bit grayscale w 8-bit alpha which i'm trying to 
read it with TIFFReadRGBAImage. unfortunately, i get an access 
violation inside the 'putgreytile' function.

	i don't know if the problem is common to all gray+alpha images or 
just this one, so here's a link to the image i'm testing with:

	http://www.smalleranimals.com/images/8gray_alpha.tif

	(warning, it's 3.55MB)

	i've tested with a clean copy of LibTiff v3.7.1, using the code 
below, and my own slightly tweaked version of v3.8.2 - same crash.
	
	any ideas ?

	-c

--------------
int
main(int argc, char* argv[])
{
      uint32* raster;
     uint32  width, height;
     uint32  row;

	 TIFF *in;
	in = TIFFOpen(argv[1], "r");

     TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width);
     TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height);

     raster = (uint32*)_TIFFmalloc(width * height * sizeof (uint32));
     if (raster == 0) {
         TIFFError(TIFFFileName(in), "No space for raster buffer");
         return (0);
     }

     if (!TIFFReadRGBAImageOriented(in, width, height, raster,
                                    ORIENTATION_TOPLEFT, 0)) {
         _TIFFfree(raster);
         return (0);
     }

	 _TIFFfree( raster );
	(void) TIFFClose(in);
	return 0;
}
----
Chris Losinger
losinger@earthlink.net
smallest@smalleranimals.com          http://www.smalleranimals.com