diff options
| author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2024-03-09 14:34:50 +0100 |
|---|---|---|
| committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2024-03-10 11:59:32 +0100 |
| commit | 003cef9d40f2e840f2690bd465994deaab5c2b95 (patch) | |
| tree | 98ec3ec9882c5dea77f2cab6f356e891122e8e91 /examples/sql/sqlbrowser/browser.cpp | |
| parent | 0804109d686e0a99ab0de0f1c70e3422183c6e98 (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.7 6.6 6.5
Change-Id: I1f27f603acbca1590c820e80f52f3b994f5ea5c7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'examples/sql/sqlbrowser/browser.cpp')
0 files changed, 0 insertions, 0 deletions
