mirror of
https://github.com/webmproject/libwebp.git
synced 2025-02-13 07:22:52 +01:00
tiffdec: fix EXTRASAMPLES check
the TIFFGetField() return for TIFFTAG_EXTRASAMPLES is defined as (count, types array) [1]. previously the count was being checked rather than the first element of the array to determine whether the alpha was associated (pre-multiplied) and the result needed to be unmultiplied. since: 9273e441 fix TIFF encoder regarding rgbA/RGBA [1] http://www.libtiff.org/man/TIFFSetField.3t.html Change-Id: I6e41be9d038fe8afb6d0aa3c8048925dc901113b
This commit is contained in:
parent
97cce5ba83
commit
1923ff0222
@ -215,7 +215,8 @@ int ReadTIFF(const uint8_t* const data, size_t data_size,
|
||||
TIFFSwabArrayOfLong(raster, width * height);
|
||||
#endif
|
||||
// if we have an alpha channel, we must un-multiply from rgbA to RGBA
|
||||
if (samples_per_px > 3 && extra_samples == 1) {
|
||||
if (extra_samples == 1 && extra_samples_ptr != NULL &&
|
||||
extra_samples_ptr[0] == EXTRASAMPLE_ASSOCALPHA) {
|
||||
uint32_t y;
|
||||
uint8_t* tmp = (uint8_t*)raster;
|
||||
for (y = 0; y < height; ++y) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user