AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2002.09.04 13:15 "Trouble setting BitsPerSample to 8", by Stains, Brian
2002.09.04 13:49 "RE: Trouble setting BitsPerSample to 8", by Stains, Brian
2002.09.04 13:42 "RE: Trouble setting BitsPerSample to 8", by Rainer Wiesenfarth
2002.09.04 23:44 "Re: Trouble setting BitsPerSample to 8", by peters
2002.09.06 12:43 "Adobe PhotoShop 6.0 and scanlined TIFF/JPEG", by Rainer Wiesenfarth

2002.09.04 13:15 "Trouble setting BitsPerSample to 8", by Stains, Brian

When I write an RGB TIFF using the following code, BitsPerSample in the resulting file is always 0,0,0. I must be missing something. Does anyone see my problem?

I can successfully write an image with BitsPerSample = 1, SamplesPerPixel = 1, PhotoMetric = MinIsBlack, and other fields as below. (Setting data is, of course, different in this case.) BitsPerSample in the resulting file is correctly set to 1.

Thanks,

Brian Stains

I'm working on WindowsNT.

TIFF* tifOut = TIFFOpen("e:\\images\\tif\\newtif.tif","w"); TIFFSetField(tifOut,TIFFTAG_IMAGEWIDTH,w);

TIFFSetField(tifOut,TIFFTAG_IMAGELENGTH,h);

TIFFSetField(tifOut,TIFFTAG_BITSPERSAMPLE,8);

TIFFSetField(tifOut,TIFFTAG_COMPRESSION,COMPRESSION_NONE);

TIFFSetField(tifOut,TIFFTAG_PHOTOMETRIC,PHOTOMETRIC_RGB);

TIFFSetField(tifOut,TIFFTAG_SAMPLESPERPIXEL, 3);

TIFFSetField(tifOut,TIFFTAG_PLANARCONFIG,PLANARCONFIG_CONTIG);

// write data with TIFFWriteScanline(...) // I can see that the data is OK because the Wang Imaging app will display this TIF,

// in spite of the incorrect BitsPerSample in the output file.

TIFFClose(tifOut);