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
August 2007

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

2007.08.07 15:27 "Indexed Images - part 2", by Christian Henning
2007.08.07 15:31 "Re: Indexed Images - part 2", by Christian Henning

2007.08.07 15:27 "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