AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2007.08.07 14:41 "[Tiff] Indexed Images", by Christian Henning
2007.08.07 03:46 "[Tiff] bilevel image scrambling when size not divisible by 8", by Lee Cooper
2007.08.07 05:02 "Re: [Tiff] bilevel image scrambling when size not divisible by 8", by Bob Friesenhahn
2007.08.07 14:48 "Re: [Tiff] Indexed Images", by Toby Thain
2007.08.07 14:57 "Re: [Tiff] Indexed Images", by Christian Henning
2007.09.27 13:13 "Re: [Tiff] TIFF for windows...", by Edward Lam
2007.09.27 06:57 "[Tiff] TIFF for windows...", by mrinal
2007.09.27 09:36 "Re: [Tiff] TIFF for windows...", by Edward Lam
2007.09.27 13:03 "Re: [Tiff] TIFF for windows...", by DB Karron
2007.08.07 15:23 "Re: [Tiff] Indexed Images", by Frank Warmerdam
2007.08.07 15:27 "[Tiff] Indexed Images - part 2", by Christian Henning
2007.08.07 15:31 "[Tiff] Re: Indexed Images - part 2", by Christian Henning
2007.08.07 15:41 "Re: [Tiff] Indexed Images", by Toby Thain
2007.08.13 22:43 "[Tiff] 16-bit palette image", by Christian Henning
2007.08.16 07:15 "Re: [Tiff] 16-bit palette image", by Reinhard Mayr aka Czerwinski
2007.08.17 19:00 "[Tiff] How to write a planar tiff file", by Christian Henning
2007.08.17 19:03 "Re: [Tiff] How to write a planar tiff file", by Toby Thain
2007.08.17 19:10 "[Tiff] How to write a planar tiff file", by Christian Henning
2007.08.17 19:57 "Re: [Tiff] How to write a planar tiff file", by Kai-Uwe Behrmann

2007.08.07 15:27 "[Tiff] Indexed Images - part 2", by Christian Henning

Hi there, it's not my day it seems. This time I'm trying to read an indexed image. But reading the color map is crashing the application. I'm using the jello.tif test image. The photometric value is set to 3 which indicates an indexed image.

Here is what I'm doing:

int main()
{
   TIFF* file = TIFFOpen( "jello.tif", "r" );

   tsize_t width;
   tsize_t height;
   short bits_per_sample;
   short samples_per_pixel;
   short photo_metric;

   TIFFGetField( file, TIFFTAG_BITSPERSAMPLE, &bits_per_sample );
   TIFFGetField( file, TIFFTAG_SAMPLESPERPIXEL, &samples_per_pixel );
   TIFFGetField( file, TIFFTAG_IMAGEWIDTH, &width );
   TIFFGetField( file, TIFFTAG_IMAGELENGTH, &height );
   TIFFGetField( file, TIFFTAG_PHOTOMETRIC, &photo_metric );

   toff_t* color_map = NULL;
   TIFFGetFieldDefaulted( file, TIFFTAG_COLORMAP, &color_map );

   return 0;
}

I'm sure it's something very simple.

Thanks in advance,

Christian