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:
parent
a0524a8443
commit
de2c3ccd49
@ -627,10 +627,10 @@ bool QPngHandlerPrivate::readPngHeader()
|
|||||||
}
|
}
|
||||||
if (primaries.areValid()) {
|
if (primaries.areValid()) {
|
||||||
colorSpace = QColorSpace(primaries.whitePoint, primaries.redPoint, primaries.greenPoint, primaries.bluePoint,
|
colorSpace = QColorSpace(primaries.whitePoint, primaries.redPoint, primaries.greenPoint, primaries.bluePoint,
|
||||||
QColorSpace::TransferFunction::Gamma, fileGamma);
|
QColorSpace::TransferFunction::Gamma, 1.0f / fileGamma);
|
||||||
} else {
|
} else {
|
||||||
colorSpace = QColorSpace(QColorSpace::Primaries::SRgb,
|
colorSpace = QColorSpace(QColorSpace::Primaries::SRgb,
|
||||||
QColorSpace::TransferFunction::Gamma, fileGamma);
|
QColorSpace::TransferFunction::Gamma, 1.0f / fileGamma);
|
||||||
}
|
}
|
||||||
colorSpaceState = GammaChrm;
|
colorSpaceState = GammaChrm;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user