summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-04-21 13:49:50 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-05-12 11:06:41 +0000
commit8363c855f5d31c3c7499b57621d79b10bc6ba088 (patch)
treef54979bfea65176dba1dff58fa83cb48b266c257 /tests
parent4c00a26fc583003059f1854bf1289c28c7f01bd6 (diff)
Correctly interpret RGBA tiff images as premultiplied
The TIFFReadRGBAImageOriented method turns out to return colors with alpha premultiplied by default. The only reason we pass our own tests is because we also save the colors incorrectly unpremultiplied. The patch fixes the format type of the returned images, and explictily writes the how alpha should be interpreted in the saved files. Change-Id: Ie1c3881acfe07eae25ca735adf243c1636f656a0 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/tiff/tst_qtiff.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/tiff/tst_qtiff.cpp b/tests/auto/tiff/tst_qtiff.cpp
index 89630c2..71c3b63 100644
--- a/tests/auto/tiff/tst_qtiff.cpp
+++ b/tests/auto/tiff/tst_qtiff.cpp
@@ -366,7 +366,7 @@ void tst_qtiff::readWriteNonDestructive_data()
QTest::addColumn<bool>("grayscale");
QTest::newRow("tiff mono") << QImage::Format_Mono << QImage::Format_Mono << false;
QTest::newRow("tiff indexed") << QImage::Format_Indexed8 << QImage::Format_Indexed8 << false;
- QTest::newRow("tiff argb32") << QImage::Format_ARGB32 << QImage::Format_ARGB32 << false;
+ QTest::newRow("tiff argb32pm") << QImage::Format_ARGB32_Premultiplied << QImage::Format_ARGB32_Premultiplied << false;
QTest::newRow("tiff rgb32") << QImage::Format_RGB32 << QImage::Format_RGB32 << false;
QTest::newRow("tiff grayscale") << QImage::Format_Indexed8 << QImage::Format_Indexed8 << true;
}
@@ -410,7 +410,7 @@ void tst_qtiff::largeTiff()
QSKIP("not tested on WinCE");
#endif
- QImage img(4096, 2048, QImage::Format_ARGB32);
+ QImage img(4096, 2048, QImage::Format_ARGB32_Premultiplied);
QPainter p(&img);
img.fill(0x0);