From 33ab1d454b1a87cd2e44c185c640565edfc73e38 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Sat, 25 Jul 2015 11:43:39 +0300 Subject: Support custom ZLIB library name(s) This is already the case for qtbase and qtwebkit, while here only hard-coded "zdll.lib" was used on Windows. Change-Id: I6592ed8cfc667db58cb7ab65f97f00fc83e8e7d5 Reviewed-by: Oswald Buddenhagen --- src/3rdparty/zlib_dependency.pri | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/zlib_dependency.pri b/src/3rdparty/zlib_dependency.pri index 74efbbb..5532acf 100644 --- a/src/3rdparty/zlib_dependency.pri +++ b/src/3rdparty/zlib_dependency.pri @@ -1,7 +1,10 @@ # zlib dependency satisfied by bundled 3rd party zlib or system zlib contains(QT_CONFIG, system-zlib) { unix|mingw: LIBS_PRIVATE += -lz - else: LIBS += zdll.lib + else { + isEmpty(ZLIB_LIBS): LIBS += zdll.lib + else: LIBS += $$ZLIB_LIBS + } } else { load(qt_build_paths) git_build: \ -- cgit v1.2.3 From e4af63c68fa91d126ee3f8489058b14c9ee127a3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 8 Feb 2016 14:56:06 +0100 Subject: Bump version Change-Id: I47f7968322cf8a73ec1cb8ad0d533fe2417fbb16 --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index 66a0241..b642527 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,3 +1,3 @@ load(qt_build_config) -MODULE_VERSION = 5.6.0 +MODULE_VERSION = 5.6.1 -- cgit v1.2.3 From 58f19cf8d51e06f1781f3142e6d872e5feb0690e Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 10 Feb 2016 10:46:00 +0100 Subject: Improve interpretation of undefined alpha-channels Libtiff does not process the alpha-channel if its definition is not specified. However to match how Qt used to save TIFF images and how tested image viewers interpret them, we need to treat unspecified alpha channels as unpremultiplied. Task-number: QTBUG-50902 Change-Id: Id72218ed5bf702b54ffa3b5b47d6230facbfa0c4 Reviewed-by: aavit --- src/plugins/imageformats/tiff/qtiffhandler.cpp | 15 +++++++++++++-- tests/auto/tiff/tst_qtiff.cpp | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/plugins/imageformats/tiff/qtiffhandler.cpp b/src/plugins/imageformats/tiff/qtiffhandler.cpp index a6b87af..875ab16 100644 --- a/src/plugins/imageformats/tiff/qtiffhandler.cpp +++ b/src/plugins/imageformats/tiff/qtiffhandler.cpp @@ -251,8 +251,19 @@ bool QTiffHandlerPrivate::openForRead(QIODevice *device) format = QImage::Format_Indexed8; else if (samplesPerPixel < 4) format = QImage::Format_RGB32; - else - format = QImage::Format_ARGB32_Premultiplied; + else { + uint16 count; + uint16 *extrasamples; + // If there is any definition of the alpha-channel, libtiff will return premultiplied + // data to us. If there is none, libtiff will not touch it and we assume it to be + // non-premultiplied, matching behavior of tested image editors, and how older Qt + // versions used to save it. + bool gotField = TIFFGetField(tiff, TIFFTAG_EXTRASAMPLES, &count, &extrasamples); + if (!gotField || !count || extrasamples[0] == EXTRASAMPLE_UNSPECIFIED) + format = QImage::Format_ARGB32; + else + format = QImage::Format_ARGB32_Premultiplied; + } headersRead = true; return true; diff --git a/tests/auto/tiff/tst_qtiff.cpp b/tests/auto/tiff/tst_qtiff.cpp index a77a735..d309c8d 100644 --- a/tests/auto/tiff/tst_qtiff.cpp +++ b/tests/auto/tiff/tst_qtiff.cpp @@ -346,6 +346,7 @@ void tst_qtiff::writeImage() QImageWriter writer(&buf, format); QVERIFY(writer.write(image)); } + image = image.convertToFormat(QImage::Format_ARGB32_Premultiplied); QImage image2; { -- cgit v1.2.3