tag tiff alpha as UNASSALPHA

we were using ASSOCALPHA, but that's only for pre-multiplied alpha
channels
This commit is contained in:
John Cupitt 2016-07-04 14:49:04 +01:00
parent 0c2259d34b
commit b81ac67a98
1 changed files with 7 additions and 1 deletions

View File

@ -162,6 +162,8 @@
* - write TIFFTAG_IMAGEDESCRIPTION
* 2/6/16
* - support strip option
* 4/7/16
* - tag alpha as UNASSALPHA since it's not pre-multiplied, thanks Peter
*/
/*
@ -675,8 +677,12 @@ write_tiff_header( Write *write, Layer *layer )
uint16 v[MAX_ALPHA];
int i;
/* EXTRASAMPLE_UNASSALPHA means generic extra
* alpha-like channels. ASSOCALPHA means pre-multipled
* alpha only.
*/
for( i = 0; i < alpha_bands; i++ )
v[i] = EXTRASAMPLE_ASSOCALPHA;
v[i] = EXTRASAMPLE_UNASSALPHA;
TIFFSetField( tif,
TIFFTAG_EXTRASAMPLES, alpha_bands, v );
}