summaryrefslogtreecommitdiffstats
path: root/src/opengl/qopenglvertexarrayobject.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2024-03-09 14:34:50 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-03-10 17:11:08 +0000
commit7ebcab3b5d1884f0c9c1771a628f03d6a0b39803 (patch)
tree18ab373336582d539fbd8e9ae5f206cd6323ec7f /src/opengl/qopenglvertexarrayobject.cpp
parentff9a3e51d38d11aaf65e9e607c4413be4056218c (diff)
PNG: preserve ICC profiles that QColorSpace does not handle
QColorSpace::isValid() returns true if QColorSpace can handle the profile. When called on a QColorSpace obtained via QColorSpace::fromIccProfile, this doesn't necessarily mean that the ICC profile itself was invalid; it could be that the ICC data was valid, but QColorSpace didn't know how to use it. This is especially true on Qt <= 6.7, where only XYZ/RGB matrix profiles were supported. We don't fully parse ICC v4, and we're lacking an API to differentiate between "ICC data was valid but QColorSpace doesn't handle it" vs "ICC data was invalid". Still, an invalid QColorSpace will still the original ICC data, so it can be saved again without loss of information. So: 1) when loading a PNG with embedded ICC data, keep the loaded profile even if it's "invalid"; 2) when writing a PNG, check if we have ICC data to save, and unconditionally write it if it's the case. This avoids data loss in the two directions. This work has been kindly sponsored by the QGIS project (https://qgis.org/). Pick-to: 6.5 Change-Id: I1f27f603acbca1590c820e80f52f3b994f5ea5c7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 003cef9d40f2e840f2690bd465994deaab5c2b95) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 712eb47886b86c816ab3b75d152b3c93b57a0c0e)
Diffstat (limited to 'src/opengl/qopenglvertexarrayobject.cpp')
0 files changed, 0 insertions, 0 deletions