| Index: Source/platform/image-decoders/png/PNGImageDecoder.cpp
|
| diff --git a/Source/platform/image-decoders/png/PNGImageDecoder.cpp b/Source/platform/image-decoders/png/PNGImageDecoder.cpp
|
| index 0af0d853df784a72520b8ca05335c58bc25fe694..ad2cae077181335926b77fbfe57f3c7dee3ad011 100644
|
| --- a/Source/platform/image-decoders/png/PNGImageDecoder.cpp
|
| +++ b/Source/platform/image-decoders/png/PNGImageDecoder.cpp
|
| @@ -371,16 +371,19 @@ void PNGImageDecoder::headerAvailable()
|
| }
|
| #endif
|
|
|
| - // Deal with gamma and keep it under our control.
|
| - double gamma;
|
| - if (!m_ignoreGammaAndColorProfile && png_get_gAMA(png, info, &gamma)) {
|
| - if ((gamma <= 0.0) || (gamma > cMaxGamma)) {
|
| - gamma = cInverseGamma;
|
| - png_set_gAMA(png, info, gamma);
|
| + if (!m_hasColorProfile) {
|
| + // Deal with gamma and keep it under our control.
|
| + double gamma;
|
| + if (!m_ignoreGammaAndColorProfile && png_get_gAMA(png, info, &gamma)) {
|
| + if ((gamma <= 0.0) || (gamma > cMaxGamma)) {
|
| + gamma = cInverseGamma;
|
| + png_set_gAMA(png, info, gamma);
|
| + }
|
| + png_set_gamma(png, cDefaultGamma, gamma);
|
| + } else {
|
| + png_set_gamma(png, cDefaultGamma, cInverseGamma);
|
| }
|
| - png_set_gamma(png, cDefaultGamma, gamma);
|
| - } else
|
| - png_set_gamma(png, cDefaultGamma, cInverseGamma);
|
| + }
|
|
|
| // Tell libpng to send us rows for interlaced pngs.
|
| if (interlaceType == PNG_INTERLACE_ADAM7)
|
|
|