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
March 2005

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

2005.03.10 10:46 "libtiff: Tiff Tag EXTRASAMPLES and TIFFRGBAImage", by Daniel Sievers
2005.03.10 16:46 "Re: libtiff: Tiff Tag EXTRASAMPLES and TIFFRGBAImage", by Joris Van Damme
2005.03.11 09:17 "Re: libtiff: Tiff Tag EXTRASAMPLES and TIFFRGBAImage", by Daniel Sievers
2005.03.15 13:44 "Re: libtiff: Tiff Tag EXTRASAMPLES and TIFFRGBAImage", by Andrey Kiselev

2005.03.11 09:17 "Re: libtiff: Tiff Tag EXTRASAMPLES and TIFFRGBAImage", by Daniel Sievers

> in line 250 of tif_getimage.c it says:
> "if (extrasamples > 1)" 

To make it more obvious why this seems strange: 

In the code below, it is checked for extrasamples>1,
but then the only item considered is sampleinfo[0]. 

For the case extrasamples==1 (the common case), img->alpha is never changed 
from the original initialization to 0. (Therefore later the alpha channel 
from the file is ignored.) 

   if (extrasamples > 1)
   {
	switch (sampleinfo[0]) {
	case EXTRASAMPLE_UNSPECIFIED:	
		if (img->samplesperpixel > 3)
			img->alpha = EXTRASAMPLE_ASSOCALPHA;
		break;
	case EXTRASAMPLE_ASSOCALPHA:	/* data is pre-multiplied */
	case EXTRASAMPLE_UNASSALPHA:	/* data is not pre-multiplied */
		img->alpha = sampleinfo[0];
		break;
	}
   }