qt6-bb10/tests/auto
Giuseppe D'Angelo 3fb3d95c33 Add support for CMYK file I/O in JPEG
JPEG part 6 defines CMYK support. This commit adds such support to the
JPEG plugin.

A *very* interesting discovery is the fact that Photoshop inverts the
meaning of the CMYK color channels when saving into JPEG: 0 means "full
ink", and 255 means "no ink". Most other image viewers/editors follow
the same interpretation, I imagine for compatibility.

But others, like Adobe Reader, don't (???) -- a PDF expects a DCT
encoding with 0 meaning "no ink". I am adding a SubType to the image I/O
handler to let the user choose what they want, defaulting to Photoshop
behavior.

Also, turns out that Qt was already loading CMYK files and converting
them to RGB. I don't think we should do automatic, lossy conversions (we
were not taking into account an eventual colorspace...), so I'm changing
that loading to yield a CMYK QImage.

Finally: save the colorspace, even if it's a CMYK image.

QColorSpace doesn't support anything but RGB matrix-based colorspaces.
Yet, it can load an arbitrary ICC profile, and will store it even if
it's unable to use it. We can use this fact to preserve the colorspace
embedded in CMYK images, or let users set an arbitrary ICC profile on
them through Qt APIs, and then saving the result in JPEG.
[ChangeLog][QtGui][JPEG] Added support for loading and saving of JPEG
files in 8-bit CMYK format. When loading a CMYK JPEG file, Qt used to
convert it automatically to a RGB image; now instead it's kept as-is.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: Ibdbfa16aa35814f5dba28c2df89577175162b731
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-04-03 22:15:42 +01:00
..
bic/data Add binary compatibility file for 6.6.0 2023-10-17 22:23:42 +03:00
cmake "Simplify" versionless targets 2024-03-12 20:27:42 +01:00
concurrent Fix truncation warning in generation_helpers 2024-03-18 20:10:34 +01:00
corelib Add equality comparison between QJsonObject and QJsonValueConstRef 2024-04-03 17:31:36 +00:00
dbus QDBusArgument: disambiguate between QMap on std::pair and std::map 2024-03-18 14:43:13 -07:00
gui Add support for CMYK file I/O in JPEG 2024-04-03 22:15:42 +01:00
guiapplauncher Turn the "concentriccircles" example into snippets, update screenshot 2023-12-14 20:06:32 +01:00
network Tests: check the output of QFile::open 2024-03-27 04:24:11 +01:00
opengl tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
other Clean up windows accessibility backend 2024-03-27 15:35:15 +01:00
printsupport Change license for tests files 2024-02-04 09:56:42 +01:00
shared Change license for tests files 2024-02-04 09:56:42 +01:00
sql CMake: Make a few more auto tests standalone 2024-03-14 01:14:18 +01:00
testlib QSignalSpy: separate messages for invalid and non-signal meta-methods 2024-03-22 15:31:39 +01:00
tools Add support for using an inline namespaces for -qtnamespace 2024-04-03 17:17:11 +02:00
wasm wasm: Disable failing selenium test temporarily 2024-04-03 10:11:09 +02:00
widgets Tests: check the output of QFile::open 2024-03-27 04:24:11 +01:00
xml QtXml: fix leak in QDomText::splitText 2024-03-02 21:22:53 +01:00
CMakeLists.txt wasm: Add qdiriterator test + minor runtime fixes 2024-03-19 10:28:06 +01:00
network-settings.h Change license for tests files 2024-02-04 09:56:42 +01:00