diff options
-rw-r--r-- | .qmake.conf | 2 | ||||
-rw-r--r-- | dist/changes-5.13.0 | 31 | ||||
-rw-r--r-- | dist/changes-5.13.1 | 24 | ||||
-rw-r--r-- | src/imageformats/doc/qtimageformats.qdocconf | 1 | ||||
-rw-r--r-- | src/plugins/imageformats/dds/qddshandler.cpp | 2 | ||||
-rw-r--r-- | src/plugins/imageformats/dds/qddshandler.h | 2 | ||||
-rw-r--r-- | src/plugins/imageformats/icns/qicnshandler.cpp | 2 | ||||
-rw-r--r-- | src/plugins/imageformats/icns/qicnshandler_p.h | 2 | ||||
-rw-r--r-- | src/plugins/imageformats/jp2/qjp2handler.cpp | 2 | ||||
-rw-r--r-- | src/plugins/imageformats/jp2/qjp2handler_p.h | 2 | ||||
-rw-r--r-- | src/plugins/imageformats/tga/qtgahandler.cpp | 2 | ||||
-rw-r--r-- | src/plugins/imageformats/tga/qtgahandler.h | 2 | ||||
-rw-r--r-- | src/plugins/imageformats/tiff/qtiffhandler.cpp | 12 | ||||
-rw-r--r-- | src/plugins/imageformats/tiff/qtiffhandler_p.h | 2 | ||||
-rw-r--r-- | src/plugins/imageformats/webp/qwebphandler.cpp | 6 | ||||
-rw-r--r-- | src/plugins/imageformats/webp/qwebphandler_p.h | 2 | ||||
-rw-r--r-- | tests/auto/tiff/tst_qtiff.cpp | 20 | ||||
-rw-r--r-- | tests/shared/images/tiff.qrc | 1 | ||||
-rw-r--r-- | tests/shared/images/tiff/gray16.tiff | bin | 0 -> 8164 bytes |
19 files changed, 113 insertions, 4 deletions
diff --git a/.qmake.conf b/.qmake.conf index b5454e5..1ed62c5 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,3 +1,3 @@ load(qt_build_config) -MODULE_VERSION = 5.12.5 +MODULE_VERSION = 5.13.1 diff --git a/dist/changes-5.13.0 b/dist/changes-5.13.0 new file mode 100644 index 0000000..e45986b --- /dev/null +++ b/dist/changes-5.13.0 @@ -0,0 +1,31 @@ +Qt 5.13 introduces many new features and improvements as well as bugfixes +over the 5.12.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.13 series is binary compatible with the 5.12.x series. +Applications compiled for 5.12 will continue to run with 5.13. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* General * +**************************************************************************** + + - The qtimageformats module now offers configuration settings + available in the global Qt configure. The image format handlers + based on external codecs can be enabled or disabled, and the choice + between bundled and system codec library can be set. + +**************************************************************************** +* TIFF * +**************************************************************************** + + - Support for reading and writing images in Grayscale16 format added. diff --git a/dist/changes-5.13.1 b/dist/changes-5.13.1 new file mode 100644 index 0000000..9716883 --- /dev/null +++ b/dist/changes-5.13.1 @@ -0,0 +1,24 @@ +Qt 5.13.1 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.13.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.13 series is binary compatible with the 5.12.x series. +Applications compiled for 5.12 will continue to run with 5.13. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Third-Party Code * +**************************************************************************** + + - Update bundled libwebp to version 1.0.3 diff --git a/src/imageformats/doc/qtimageformats.qdocconf b/src/imageformats/doc/qtimageformats.qdocconf index a45751d..f12fe14 100644 --- a/src/imageformats/doc/qtimageformats.qdocconf +++ b/src/imageformats/doc/qtimageformats.qdocconf @@ -1,4 +1,5 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) +include($QT_INSTALL_DOCS/config/exampleurl-qtimageformats.qdocconf) # Name of the project. project = QtImageFormats diff --git a/src/plugins/imageformats/dds/qddshandler.cpp b/src/plugins/imageformats/dds/qddshandler.cpp index 3a44b51..845f9b3 100644 --- a/src/plugins/imageformats/dds/qddshandler.cpp +++ b/src/plugins/imageformats/dds/qddshandler.cpp @@ -1382,10 +1382,12 @@ QDDSHandler::QDDSHandler() : { } +#if QT_DEPRECATED_SINCE(5, 13) QByteArray QDDSHandler::name() const { return QByteArrayLiteral("dds"); } +#endif bool QDDSHandler::canRead() const { diff --git a/src/plugins/imageformats/dds/qddshandler.h b/src/plugins/imageformats/dds/qddshandler.h index 665bd16..f4bc888 100644 --- a/src/plugins/imageformats/dds/qddshandler.h +++ b/src/plugins/imageformats/dds/qddshandler.h @@ -53,7 +53,9 @@ class QDDSHandler : public QImageIOHandler public: QDDSHandler(); +#if QT_DEPRECATED_SINCE(5, 13) QByteArray name() const override; +#endif bool canRead() const override; bool read(QImage *image) override; diff --git a/src/plugins/imageformats/icns/qicnshandler.cpp b/src/plugins/imageformats/icns/qicnshandler.cpp index a854506..9733ed7 100644 --- a/src/plugins/imageformats/icns/qicnshandler.cpp +++ b/src/plugins/imageformats/icns/qicnshandler.cpp @@ -651,10 +651,12 @@ QICNSHandler::QICNSHandler() : { } +#if QT_DEPRECATED_SINCE(5, 13) QByteArray QICNSHandler::name() const { return QByteArrayLiteral("icns"); } +#endif bool QICNSHandler::canRead(QIODevice *device) { diff --git a/src/plugins/imageformats/icns/qicnshandler_p.h b/src/plugins/imageformats/icns/qicnshandler_p.h index 84c7bf1..b532045 100644 --- a/src/plugins/imageformats/icns/qicnshandler_p.h +++ b/src/plugins/imageformats/icns/qicnshandler_p.h @@ -132,7 +132,9 @@ public: bool read(QImage *image) override; bool write(const QImage &image) override; +#if QT_DEPRECATED_SINCE(5, 13) QByteArray name() const override; +#endif bool supportsOption(ImageOption option) const override; QVariant option(ImageOption option) const override; diff --git a/src/plugins/imageformats/jp2/qjp2handler.cpp b/src/plugins/imageformats/jp2/qjp2handler.cpp index 17373fd..ce23480 100644 --- a/src/plugins/imageformats/jp2/qjp2handler.cpp +++ b/src/plugins/imageformats/jp2/qjp2handler.cpp @@ -308,6 +308,7 @@ bool QJp2Handler::supportsOption(ImageOption option) const return (option == Quality || option == SubType); } +#if QT_DEPRECATED_SINCE(5, 13) /*! Return the common identifier of the format. For JPEG 2000 this will return "jp2". @@ -316,6 +317,7 @@ QByteArray QJp2Handler::name() const { return QByteArrayLiteral("jp2"); } +#endif /*! Automatic resource handling for a jas_image_t*. diff --git a/src/plugins/imageformats/jp2/qjp2handler_p.h b/src/plugins/imageformats/jp2/qjp2handler_p.h index e81ec9e..16ddc8a 100644 --- a/src/plugins/imageformats/jp2/qjp2handler_p.h +++ b/src/plugins/imageformats/jp2/qjp2handler_p.h @@ -64,7 +64,9 @@ public: QVariant option(ImageOption option) const override; void setOption(ImageOption option, const QVariant &value) override; bool supportsOption(ImageOption option) const override; +#if QT_DEPRECATED_SINCE(5, 13) QByteArray name() const override; +#endif private: Q_DECLARE_PRIVATE(QJp2Handler) diff --git a/src/plugins/imageformats/tga/qtgahandler.cpp b/src/plugins/imageformats/tga/qtgahandler.cpp index 8f5eb12..9277e50 100644 --- a/src/plugins/imageformats/tga/qtgahandler.cpp +++ b/src/plugins/imageformats/tga/qtgahandler.cpp @@ -98,10 +98,12 @@ bool QTgaHandler::read(QImage *image) return !image->isNull(); } +#if QT_DEPRECATED_SINCE(5, 13) QByteArray QTgaHandler::name() const { return "tga"; } +#endif QVariant QTgaHandler::option(ImageOption option) const { diff --git a/src/plugins/imageformats/tga/qtgahandler.h b/src/plugins/imageformats/tga/qtgahandler.h index 5ef7e02..6550a11 100644 --- a/src/plugins/imageformats/tga/qtgahandler.h +++ b/src/plugins/imageformats/tga/qtgahandler.h @@ -55,7 +55,9 @@ public: bool canRead() const override; bool read(QImage *image) override; +#if QT_DEPRECATED_SINCE(5, 13) QByteArray name() const override; +#endif static bool canRead(QIODevice *device); diff --git a/src/plugins/imageformats/tiff/qtiffhandler.cpp b/src/plugins/imageformats/tiff/qtiffhandler.cpp index e6c7175..3d404bd 100644 --- a/src/plugins/imageformats/tiff/qtiffhandler.cpp +++ b/src/plugins/imageformats/tiff/qtiffhandler.cpp @@ -272,6 +272,8 @@ bool QTiffHandlerPrivate::readHeaders(QIODevice *device) format = QImage::Format_Mono; else if (photometric == PHOTOMETRIC_MINISBLACK && bitPerSample == 8 && samplesPerPixel == 1) format = QImage::Format_Grayscale8; + else if (photometric == PHOTOMETRIC_MINISBLACK && bitPerSample == 16 && samplesPerPixel == 1) + format = QImage::Format_Grayscale16; else if ((grayscale || photometric == PHOTOMETRIC_PALETTE) && bitPerSample == 8 && samplesPerPixel == 1) format = QImage::Format_Indexed8; else if (samplesPerPixel < 4) @@ -402,9 +404,11 @@ bool QTiffHandler::read(QImage *image) } } bool format8bit = (format == QImage::Format_Mono || format == QImage::Format_Indexed8 || format == QImage::Format_Grayscale8); + bool format16bit = (format == QImage::Format_Grayscale16); bool format64bit = (format == QImage::Format_RGBX64 || format == QImage::Format_RGBA64 || format == QImage::Format_RGBA64_Premultiplied); - if (format8bit || format64bit) { + // Formats we read directly, instead of over RGBA32: + if (format8bit || format16bit || format64bit) { int bytesPerPixel = image->depth() / 8; if (format == QImage::Format_RGBX64) bytesPerPixel = 6; @@ -513,6 +517,7 @@ static QVector<QRgb> effectiveColorTable(const QImage &image) colors[i] = qRgba(0, 0, 0, i); break; case QImage::Format_Grayscale8: + case QImage::Format_Grayscale16: colors.resize(256); for (int i = 0; i < 256; ++i) colors[i] = qRgb(i, i, i); @@ -622,6 +627,7 @@ bool QTiffHandler::write(const QImage &image) TIFFClose(tiff); } else if (format == QImage::Format_Indexed8 || format == QImage::Format_Grayscale8 + || format == QImage::Format_Grayscale16 || format == QImage::Format_Alpha8) { QVector<QRgb> colorTable = effectiveColorTable(image); bool isGrayscale = checkGrayscale(colorTable); @@ -631,7 +637,7 @@ bool QTiffHandler::write(const QImage &image) photometric = PHOTOMETRIC_MINISWHITE; if (!TIFFSetField(tiff, TIFFTAG_PHOTOMETRIC, photometric) || !TIFFSetField(tiff, TIFFTAG_COMPRESSION, compression == NoCompression ? COMPRESSION_NONE : COMPRESSION_LZW) - || !TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, 8) + || !TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, image.depth()) || !TIFFSetField(tiff, TIFFTAG_ROWSPERSTRIP, defaultStripSize(tiff))) { TIFFClose(tiff); return false; @@ -799,10 +805,12 @@ bool QTiffHandler::write(const QImage &image) return true; } +#if QT_DEPRECATED_SINCE(5, 13) QByteArray QTiffHandler::name() const { return "tiff"; } +#endif QVariant QTiffHandler::option(ImageOption option) const { diff --git a/src/plugins/imageformats/tiff/qtiffhandler_p.h b/src/plugins/imageformats/tiff/qtiffhandler_p.h index 2090e38..c2eb412 100644 --- a/src/plugins/imageformats/tiff/qtiffhandler_p.h +++ b/src/plugins/imageformats/tiff/qtiffhandler_p.h @@ -55,7 +55,9 @@ public: bool read(QImage *image) override; bool write(const QImage &image) override; +#if QT_DEPRECATED_SINCE(5, 13) QByteArray name() const override; +#endif static bool canRead(QIODevice *device); diff --git a/src/plugins/imageformats/webp/qwebphandler.cpp b/src/plugins/imageformats/webp/qwebphandler.cpp index 578a701..454d654 100644 --- a/src/plugins/imageformats/webp/qwebphandler.cpp +++ b/src/plugins/imageformats/webp/qwebphandler.cpp @@ -218,6 +218,10 @@ bool QWebpHandler::write(const QImage &image) qWarning() << "source image is null."; return false; } + if (std::max(image.width(), image.height()) > WEBP_MAX_DIMENSION) { + qWarning() << "QWebpHandler::write() source image too large for WebP: " << image.size(); + return false; + } QImage srcImage = image; bool alpha = srcImage.hasAlphaChannel(); @@ -310,10 +314,12 @@ bool QWebpHandler::supportsOption(ImageOption option) const || option == BackgroundColor; } +#if QT_DEPRECATED_SINCE(5, 13) QByteArray QWebpHandler::name() const { return QByteArrayLiteral("webp"); } +#endif int QWebpHandler::imageCount() const { diff --git a/src/plugins/imageformats/webp/qwebphandler_p.h b/src/plugins/imageformats/webp/qwebphandler_p.h index 950b501..31574b4 100644 --- a/src/plugins/imageformats/webp/qwebphandler_p.h +++ b/src/plugins/imageformats/webp/qwebphandler_p.h @@ -56,7 +56,9 @@ public: ~QWebpHandler(); public: +#if QT_DEPRECATED_SINCE(5, 13) QByteArray name() const override; +#endif bool canRead() const override; bool read(QImage *image) override; diff --git a/tests/auto/tiff/tst_qtiff.cpp b/tests/auto/tiff/tst_qtiff.cpp index 9c815d5..b2c5546 100644 --- a/tests/auto/tiff/tst_qtiff.cpp +++ b/tests/auto/tiff/tst_qtiff.cpp @@ -85,6 +85,7 @@ private slots: void tiled(); void readRgba64(); + void readGray16(); private: QString prefix; @@ -168,6 +169,7 @@ void tst_qtiff::readImage_data() QTest::newRow("tiled_oddsize_grayscale") << QString("tiled_oddsize_grayscale.tiff") << QSize(59, 71); QTest::newRow("tiled_oddsize_mono") << QString("tiled_oddsize_mono.tiff") << QSize(59, 71); QTest::newRow("16bpc") << QString("16bpc.tiff") << QSize(64, 46); + QTest::newRow("gray16") << QString("gray16.tiff") << QSize(64, 46); } void tst_qtiff::readImage() @@ -178,9 +180,13 @@ void tst_qtiff::readImage() QString path = prefix + fileName; QImageReader reader(path); QVERIFY(reader.canRead()); + QImage::Format headerFormat = reader.imageFormat(); + QSize headerSize = reader.size(); QImage image = reader.read(); QVERIFY(!image.isNull()); QCOMPARE(image.size(), size); + QCOMPARE(image.size(), headerSize); + QCOMPARE(image.format(), headerFormat); } void tst_qtiff::readCorruptImage_data() @@ -386,7 +392,8 @@ void tst_qtiff::readWriteNonDestructive_data() QTest::newRow("tiff indexed") << QImage::Format_Indexed8 << QImage::Format_Indexed8 << QImageIOHandler::TransformationMirror; QTest::newRow("tiff argb32pm") << QImage::Format_ARGB32_Premultiplied << QImage::Format_ARGB32_Premultiplied << QImageIOHandler::TransformationRotate90; QTest::newRow("tiff rgb32") << QImage::Format_RGB32 << QImage::Format_RGB32 << QImageIOHandler::TransformationRotate270; - QTest::newRow("tiff grayscale") << QImage::Format_Grayscale8 << QImage::Format_Grayscale8 << QImageIOHandler::TransformationFlip; + QTest::newRow("tiff grayscale8") << QImage::Format_Grayscale8 << QImage::Format_Grayscale8 << QImageIOHandler::TransformationFlip; + QTest::newRow("tiff grayscale16") << QImage::Format_Grayscale16 << QImage::Format_Grayscale16 << QImageIOHandler::TransformationMirror; QTest::newRow("tiff rgb64") << QImage::Format_RGBX64 << QImage::Format_RGBX64 << QImageIOHandler::TransformationNone; QTest::newRow("tiff rgba64") << QImage::Format_RGBA64 << QImage::Format_RGBA64 << QImageIOHandler::TransformationRotate90; QTest::newRow("tiff rgba64pm") << QImage::Format_RGBA64_Premultiplied << QImage::Format_RGBA64_Premultiplied << QImageIOHandler::TransformationNone; @@ -609,5 +616,16 @@ void tst_qtiff::readRgba64() QCOMPARE(image.format(), QImage::Format_RGBX64); } +void tst_qtiff::readGray16() +{ + QString path = prefix + QString("gray16.tiff"); + QImageReader reader(path); + QVERIFY(reader.canRead()); + QCOMPARE(reader.imageFormat(), QImage::Format_Grayscale16); + QImage image = reader.read(); + QVERIFY(!image.isNull()); + QCOMPARE(image.format(), QImage::Format_Grayscale16); +} + QTEST_MAIN(tst_qtiff) #include "tst_qtiff.moc" diff --git a/tests/shared/images/tiff.qrc b/tests/shared/images/tiff.qrc index 91bbf93..e1ce9da 100644 --- a/tests/shared/images/tiff.qrc +++ b/tests/shared/images/tiff.qrc @@ -51,5 +51,6 @@ <file>tiff/tiled_oddsize_mono.tiff</file> <file>tiff/oddsize_mono.tiff</file> <file>tiff/tiled_rgb.tiff</file> + <file>tiff/gray16.tiff</file> </qresource> </RCC> diff --git a/tests/shared/images/tiff/gray16.tiff b/tests/shared/images/tiff/gray16.tiff Binary files differnew file mode 100644 index 0000000..aeeb045 --- /dev/null +++ b/tests/shared/images/tiff/gray16.tiff |