Commit Graph

91 Commits

Author SHA1 Message Date
Tor Arne Vestbø 1bf5692d3f HEIF: Resolve primary image index from image source
The primary image, in the case of multi-image sources, may not
necessarily be the first image.

Test images produced with patched version of enc-heif that
allowed overriding the primary image. The correct primary
image is green, while the other image is red.

Pick-to: 6.10
Change-Id: Iba26b13fdb4898d7babc5fb173ad38b16f864e80
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-08-22 14:16:03 +02:00
Eirik Aavitsland d05635e2a8 Blacklist a failing test on vxworks
No apparent reason for this to suddenly start failing while all the
similar ones pass, so blacklist it to unblock CI while investigating.

Task-number: QTBUG-130617
Change-Id: I1112f39b75b3d54d5d612ea95e010a5ad31c062b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-10-29 13:09:00 +01:00
Eirik Aavitsland 7ab8952608 Fix macjp2 canRead() function
The canRead() function is supposed to check for the presence of a 12
byte magic number (header). It used qstrncmp() for this, but as the
byte sequence starts with 0 values, the comparison would end after the
first byte, and any data also starting with a 0 value would be taken
as matching.

This would make QImageReader mis-identify the image format of image
data where an explicit suffix or data format was lacking, resulting in
image reading failures. The macheif autotest would hit this issue and
fail erroneously.

Pick-to: 6.8 6.7 6.5
Change-Id: I39b1ba9a344478fe1255c89f19488f0bc54d2ec1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-06-03 15:47:15 +02:00
Tor Arne Vestbø 138fe46bca Blacklist tst_qheif::writeImage() on macOS 12 ARM
The codec doesn't seem to be supported on macOS 12 ARM VMs, giving:

IOServiceMatchingfailed for: AppleM2ScalerCSCDriver
887464167 0 AVE ERR: AppleAVEVA_DriverCreate:1105 serviceObject != 0 |
AppleAVEVA ERROR: IOServiceGetMatchingService failed
887464428 0 AVE ERR: AVE_CreateInstance:3985 false | FIG:
kVTCouldNotFindVideoEncoderErr.
887464466 0 AVE ERR: AppleAVEVA_DriverDelete:1448 pDriverInstance |
AppleAVEVA ERROR: AppleAVEVA_DriverDelete, pDriverInstance NULL.
887464496 0 AVE ERR: AVE_HEVCFinalize:4092 err == noErr | FIG:
AppleAVEVA_DriverDelete failed.
887465447 0 AVE ERR: AppleAVEVA_DriverCreate:1105 serviceObject != 0 |
AppleAVEVA ERROR: IOServiceGetMatchingService failed
887465478 0 AVE ERR: AVE_CreateInstance:3985 false | FIG:
kVTCouldNotFindVideoEncoderErr.
887465500 0 AVE ERR: AppleAVEVA_DriverDelete:1448 pDriverInstance |
AppleAVEVA ERROR: AppleAVEVA_DriverDelete, pDriverInstance NULL.
887465530 0 AVE ERR: AVE_HEVCFinalize:4092 err == noErr | FIG:
AppleAVEVA_DriverDelete failed.

But works fine in macOS 13 and 14 ARM VMs. So we blacklist the test.

Pick-to: 6.8
Change-Id: I52b0101375cad12d3129f8724d7bc7c9ce3afcae
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2024-06-03 12:05:15 +02:00
Giuseppe D'Angelo e4c8cd1f09 TIFF: add an autotest for CMYK images
This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: I09cf744f1b8c907a296a8525ec11a4980282d743
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-04-08 08:36:57 +02:00
Lucie Gérard cd3a1377a6 Correct license for test files
According to QUIP-18 [1], all test files should be
LicenseRef-Qt-Commercial OR GPL-3.0-only

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I9cf2eefe287996e7cc75fbde3832d4692797522e
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-03-15 15:10:22 +01:00
Friedemann Kleint 93ece87be2 Remove remains of qmake conversion from CMakeLists.txt files
Pick-to: 6.5
Change-Id: Ic00df7d45246270d724b3b1d1ef9d13d76dcc136
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-02-08 16:20:50 +01:00
Marc Mutz b3cbf8d925 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: Ie5b276174d8446a6ddbca11a6a8e3e07d3bca675
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-10-06 18:06:26 +02:00
Tor Arne Vestbø 4ee8adc010 Update HEIF test image
The original image stopped working on macOS 13 Ventura, both with our
image plugin and in Preview. It's unclear why the original image works
fine in Preview on macOS 12, but that's an Apple bug, and our image
plugin tests should not have to worry about platform differences like
that.

Task-number: QTBUG-104210
Pick-to: 6.4 6.2
Change-Id: If57fce379a2d9bcb92757e3f2f7e903b079e700b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-13 17:00:53 +02:00
Alexandru Croitor d7f621d3d3 CMake: Don't build iOS auto tests when QT_BUILD_MINIMAL_STATIC_TEST
is set, so that integrations don't fail.

In the future we might add build-only tests like we have in qtbase.

Pick-to: 6.4
Task-number: QTBUG-96056
Change-Id: I84ccc93eb02b807702117b814d4969ccec62ffe2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-09-07 14:52:20 +02:00
Lucie Gérard c47e029e79 Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: I3598499ab89b0e88718eded846306511000e8db9
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-25 10:17:22 +02:00
Alexandru Croitor d5f186093e CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers
Change-Id: I9e34269e7cfd5d3ee6edc1c07775d05b86d9bc78
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-28 11:42:26 +02:00
Lucie Gérard 238affae87 Add license headers to cmake files
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.

Existing copyright statements remain intact

Task-number: QTBUG-88621
Change-Id: Ifbf0be4c6f03259f9d084bbef4cf44fa60bf3fde
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-07-07 18:18:28 +02:00
Lucie Gérard 8a62fb36a8 Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I775d4a0c07b2b82a097d36649203e7f6223fdc51
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-06-13 10:06:20 +02:00
Robert Löhning a678f3df9d Add finding from oss-fuzz to tst_qicns
Pick-to: 6.3 6.2 5.15
Task-number: QTBUG-103454
Change-Id: I86bf891e67bcd483ed0b551190244b94677d1751
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-05-25 08:10:01 +00:00
Tatiana Borisova 85a2a1c9a7 Fix tst_qicns test for INTEGRITY
- There is no possibility to use file system on our INTEGRITY test device.
  Add test sciping

Task-number: QTBUG-99123
Pick-to: 6.2 6.3
Change-Id: Icb84eb73b6010d4aa4ca19a4d3a0ecaa02216a6f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-01-24 07:25:03 +00:00
Joerg Bornemann 7917a6eea8 Remove unused .qrc files
Task-number: QTBUG-94446
Change-Id: I10e6f70d91bf74b13fe6713f2af5cc11a36e7e2b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-01-18 17:22:40 +01:00
Allan Sandfeld Jensen 95f02ee91f Add floating point read and write to TIFF handler
[ChangeLog][TIFF] Read/write support for floating point image
formats added.

Change-Id: Ib952ef9bfe7e38426f018515a5f92ed56c732a6f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-06-01 08:46:57 +02:00
Joerg Bornemann af068aada2 Use fixed qt_add_resource BASE argument
Pick-to: 6.1
Task-number: QTBUG-86726
Change-Id: I7457f9336915e5913c6c98053db979eb9ca197a5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-21 14:05:44 +02:00
Joerg Bornemann f60105ed26 Remove QMake project files
This includes removal of the corresponding .prev_CMakeLists.txt files.

Pick-to: 6.1
Task-number: QTBUG-88742
Change-Id: I43bd344cd515aa2f671d012c64f281e8fc4793c9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2021-02-11 16:43:58 +01:00
Alexandru Croitor fd9d3b4dce CMake: Regenerate projects to use new qt_internal_ API
Modify special case locations to use the new API as well.

Task-number: QTBUG-86815
Change-Id: I045015a4f3b78f15570ea401d2b99ea1b75ec414
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-01 12:10:12 +02:00
Liang Qi d85ec62142 Update dependencies on 'dev' in qt/qtimageformats
Change-Id: Iac64f53518ad8a8fefe0a2305953b5ec727a7fd4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-29 09:55:44 +02:00
Jarek Kobus c64f19516d Use QList instead of QVector
Task-number: QTBUG-84469
Change-Id: I2edb875a4c3742adc9f52becb727e709a2beb7b9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-08 10:33:19 +02:00
Alexandru Croitor c96422ae94 CMake: Regenerate and fixup qtimageformats projects
A few changes happened since last update:
- CMake target names are now consistent with Qt 5 names
- ZLIB handling
- TIFF 3rd party handling
- Standalone tests simplification
- Updates in the SUBDIRS project
- Other minor changes

Change-Id: I85cca79d38feca44c5b78dae48c79779ae05e288
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-16 18:02:19 +00:00
Alexandru Croitor 51e7fa714c Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts:
	dependencies.yaml

Change-Id: Ia9a6efda0bea5bc7c5f9f8cd4735da0bd3c0da26
2020-03-16 17:07:23 +01:00
Qt Forward Merge Bot 71885caad7 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I6e079d36038a811d3259e2a5a147601fbf5640fc
2019-12-24 03:03:02 +01:00
Eirik Aavitsland 6124b900d9 Add support for reading BigTIFF
All recent versions of libtiff has support for the 64bit-indexed
BigTIFF format. Allow reading it by recognizing its magic number.

[ChangeLog][TIFF] Add support for reading BigTIFF

Fixes: QTBUG-80538
Change-Id: I7fcb72d77e4a0bdcb38ab96e9f6cfaff7cf4ad49
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-12-20 10:12:39 +01:00
Alexandru Croitor 4c932c4034 Regenerate projects to be in sync with the script
Change-Id: I30d599c2f5e74293ff7037b5e667c0a3dab5be87
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-15 12:21:00 +00:00
Alexandru Croitor a56d52b553 Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: Ib8c81669bd2f83c829fab625623452e4891b2356
2019-10-15 14:26:06 +02:00
Alexandru Croitor 36c362412b Regenerate projects before merge
Change-Id: I9a889214e310b95ca1418925d6413602f9e00cea
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-15 12:23:59 +00:00
Simon Hausmann 05aed6f25f Merge remote-tracking branch 'origin/wip/qt6' into dev
Change-Id: I1b25b31fb8e8cd8f3e73c51cc0e4a233b6ef3363
2019-09-18 11:56:07 +02:00
Simon Hausmann 7aa428b89c Merge remote-tracking branch 'origin/dev' into wip/qt6
Conflicts:
	.qmake.conf

Change-Id: I6cb3354f6a16aa94a7e463db6ac8bf941b0c500f
2019-09-16 22:44:48 +02:00
Tor Arne Vestbø 44000c87d3 Fix build after QColorSpace API changes
Change-Id: Iff3186cf4eccae5fc7e7e3c55c5e6eb662be9519
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-09-05 11:40:30 +02:00
Alexandru Croitor 1d4a58a877 Add build and test instructions
Change-Id: I4d52be7d162949ebc3e2122eb31ef64fce110d15
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-09-05 08:15:35 +00:00
Allan Sandfeld Jensen d63c1d05e4 Read/write ICC profile in TIFF plugin
Adds reading and writing of embedded color spaces on the TIFF plugin.

Change-Id: I53e8a16ff65f7986e9d51a5b543335e27b43e346
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-08-17 10:09:08 +02:00
Alexandru Croitor 9cf98b08da Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: Idf48bddde98d108d3692eddb8971affcc691a614
2019-08-15 18:24:13 +02:00
Alexandru Croitor 11f8dc2d83 Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: Ic0596108d4f3af40f68e07b53a436eeb07fc9f55
2019-08-11 10:32:53 +02:00
Marc Mutz 633f77e8e9 Eradicate the last Q_FOREACH and mark the module clean
... of Q_FOREACH, Java-style iterators, and QLinkedList use.

Change-Id: Ie751d771f226718ae7b8b19e502cbfb49730af3a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-03 21:48:49 +02:00
Alexandru Croitor 981aa49d19 Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I99e95abde299432d6ea63eabd8d1f0b5b82a3039
2019-06-17 16:14:46 +02:00
Alexandru Croitor 2762073738 Fix qt6 build
Bumped version.
Adjusted code for removal of the TransformedByDefault enum.
The enum is removed in Qt6 code, so existing tests need to be adapted
to call setAutoTransform() for plugins that usually had autoTransform
enabled by default.
The new Qt6 default is that all plugins have autoTransform disabled
by default.

Change-Id: Ifa45375a4bc42ba1d863cb96af16776ea6dd0632
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-06-14 19:14:14 +02:00
Alexandru Croitor 2a9ae46b62 Support standalone tests building
Change-Id: Ibcc29db9193a673b5b080ba79075cb50c89e4298
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-06-03 12:54:05 +00:00
Alexandru Croitor 9443239c2c Initial CMake Port
Port 90% of imageformats to be built with CMake.

Missing support for mng plugin and documentation.

Change-Id: I1d7e4b93c6f8446468f00dbf0663a6a4ec8c9774
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-28 12:50:42 +00:00
Qt Forward Merge Bot 9293902f32 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	.qmake.conf

Change-Id: Ie44fe655653166bf5a4436aedd80d060afa45d5a
2019-03-27 10:29:42 +01:00
Eirik Aavitsland 434aa248ad Heic handler: fix orientation and other image properties
The mac heic handler lacked support for any meta-data i/o. Most
notably, the image orientation proprty was ignored, so images read in
could be wrongly oriented.

Fixes: QTBUG-73415
Change-Id: I779f91dc28c7441b124aab4557e1abcd3e69fde9
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-03-26 12:48:59 +00:00
Allan Sandfeld Jensen 9f69817344 Add Grayscale16 support to TIFF
Change-Id: I927d9ab0af78baf90d8fd8d44088218dff0e7082
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-01-03 09:36:03 +00:00
Allan Sandfeld Jensen 2842212e88 Add RGBA64 format support to TIFF plugin
TIFF is one of the primary formats for HDR images.

Change-Id: I5310b5c9a625fd3e759e5120be6ba547c633c81c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-08-23 11:54:53 +00:00
Eirik Aavitsland b9ba221756 webp handler: support alpha-less reading and writing
Webp files can be with or without alpha channel. The handler would
ignore this and read all as Format_ARGB32 images, and write all as
having alpha, in both cases losing that important bit of information.

As a driveby, simplify the endianness handling in write(). By always
converting the source image to an endianness-independent QImage
format, no special handling is required.

Task-number: QTBUG-48628
Change-Id: I624ed72b18a8b59a542979efcb4e8ff81214e0d7
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-05-28 11:15:48 +00:00
Eirik Aavitsland c7f2abe551 Add native Darwin handler for the HEIF (.heic) format
Adds basic support for still images encoded with the HEIF standard
introduced in macOS Sierra and IOS 11.

Uses the Core Graphics Image I/O Framework as codec backend.
Reuses the helper class from the macjp2 handler.

Change-Id: I5f0c7891b189a916cccd2c27eacbac12416ce209
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-10-30 08:11:38 +00:00
J-P Nurmi 85ed63f825 Fix QWebpHandler::canRead() to take animation frame count into account
Task-number: QTBUG-61641
Change-Id: I24a139cc75141a588f2ed2558da85cd2f8391af9
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-07-03 12:18:45 +00:00
Eirik Aavitsland c7a6a451a5 Extend support for tiled tiff files to all color formats
This commit extends the recently added support for tiled tiff images
of color index format to also cover grayscale and mono images. RGB
images were already covered, since the libtiff API used for those
handles tiled images transparently.

This commit also simplifies the tiff read() function by sharing
common code among the different formats.

[ChangeLog][TIFF] Extend support for tiled tiff files to all color formats

Change-Id: I13f94bbca65dd6a35384a415906034e245ad8b79
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-03-16 14:08:34 +00:00