Fix reading gamma from PNGs without ICC profile

The decoding of PNG_INFO_gAMA to QColorSpace was incorrect, the PNG
gamma is the inverse of the gamma value we use. We revert it
everywhere else, just not here.

Pick-to: 6.2 5.15
Change-Id: Ic0ae1963b2dde3004cac8a6430ddaf99e7096915
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
Allan Sandfeld Jensen 2021-06-09 15:51:54 +02:00
parent a0524a8443
commit de2c3ccd49

View File

@ -627,10 +627,10 @@ bool QPngHandlerPrivate::readPngHeader()
}
if (primaries.areValid()) {
colorSpace = QColorSpace(primaries.whitePoint, primaries.redPoint, primaries.greenPoint, primaries.bluePoint,
QColorSpace::TransferFunction::Gamma, fileGamma);
QColorSpace::TransferFunction::Gamma, 1.0f / fileGamma);
} else {
colorSpace = QColorSpace(QColorSpace::Primaries::SRgb,
QColorSpace::TransferFunction::Gamma, fileGamma);
QColorSpace::TransferFunction::Gamma, 1.0f / fileGamma);
}
colorSpaceState = GammaChrm;
}