| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2005.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;
}
}
|
|||||||