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 23:44 "Re: Trouble setting BitsPerSample to 8", by peters

This is the order I set them in and it works fine.

TIFFSetField(ti->tiff, TIFFTAG_IMAGEWIDTH, (uint32)driver->width); TIFFSetField(ti->tiff, TIFFTAG_IMAGELENGTH, (uint32)driver->height);

   TIFFSetField(ti->tiff, TIFFTAG_XRESOLUTION, (float)driver->wres);
   TIFFSetField(ti->tiff, TIFFTAG_YRESOLUTION, (float)driver->hres);
   TIFFSetField(ti->tiff, TIFFTAG_COMPRESSION, compression);
   TIFFSetField(ti->tiff, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
   TIFFSetField(ti->tiff, TIFFTAG_MINSAMPLEVALUE, (short)0);
   TIFFSetField(ti->tiff, TIFFTAG_MAXSAMPLEVALUE, (short) 255);
   TIFFSetField(ti->tiff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
   TIFFSetField(ti->tiff, TIFFTAG_ROWSPERSTRIP, 1L);
   TIFFSetField(ti->tiff, TIFFTAG_BITSPERSAMPLE, 8);
   TIFFSetField(ti->tiff, TIFFTAG_IMAGEDESCRIPTION, driver->ssjob->name);
   TIFFSetField(ti->tiff, TIFFTAG_DOCUMENTNAME, driver->ssjob->name);
   TIFFSetField(ti->tiff, TIFFTAG_ARTIST, progname);
   TIFFSetField(ti->tiff, TIFFTAG_SAMPLESPERPIXEL, 3);
   TIFFSetField(ti->tiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);

--
Peter Skarpetis
Serendipity Software Pty Ltd
67 Fitzroy Street
Surry Hills NSW 2010
Sydney Australia

Phone: +612 93321788
Fax:   +612 93321766
email: peters@serendipity-software.com.au
WWW:   http://www.riponce.com

Gute Idee, Herr Wiesenfarth. Danke.

However, I forgot to mention that I already tried setting the fields in various different orders, and nothing seemed to help.

Brian

-----Original Message-----

From: Rainer Wiesenfarth [mailto:Rainer.Wiesenfarth@inpho.de] Sent: Wednesday, September 04, 2002 9:43 AM To: Stains, Brian; tiff@olympiakos.com Subject: RE: Trouble setting BitsPerSample to 8

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

From: Stains, Brian [mailto:BStains@docucorp.com]

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?

> (...)

Maybe you have to set SamplesPerPixel _before_ setting BitsPerSample?

Just a guess...

- -- Smaragdweg 1                  Phone : +49 711 22881-10
- -- 70174 Stuttgart               Fax   : +49 711 22881-11
- -- Germany                       URL   : http://www.inpho.de

-----BEGIN PGP SIGNATURE-----
Version: PGP 7.0.4

iQA/AwUBPXYN1lAwQIMgoAFnEQLuzwCfbcJaAspZH7ZxaIGTZXEJAZkydXIAn1Jz 7/auIzdeu6bQ3FMRu9P7SkJy

=4HWt
-----END PGP SIGNATURE-----