summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2012-01-31 07:01:22 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-01 13:31:19 +0100
commitf68a3dc48d8fb8c04fe49dd9e5d07d7cdd221ad1 (patch)
tree137aa3af58a368da64717d2f03cadfb9e959a2d6 /tests
parent261721488876e5661904b880782b0254d00c25ac (diff)
Add TIFF plugin
Moved out from qtbase. Task-number: QTBUG-23887 Change-Id: I57d30173e6624d41dba1610084a7ed949ae84d1d Reviewed-by: aavit <qt_aavit@ovi.com> Sanity-Review: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/auto.pro2
-rw-r--r--tests/auto/tiff/tiff.pro11
-rw-r--r--tests/auto/tiff/tst_qtiff.cpp523
-rw-r--r--tests/benchmarks/benchmarks.pro4
-rw-r--r--tests/benchmarks/tiff/tiff.pro10
-rw-r--r--tests/benchmarks/tiff/tst_qtiff.cpp151
-rw-r--r--tests/shared/images/tiff.qrc44
-rw-r--r--tests/shared/images/tiff/colorful.bmpbin0 -> 65002 bytes
-rw-r--r--tests/shared/images/tiff/corrupt-data.tifbin0 -> 8590 bytes
-rw-r--r--tests/shared/images/tiff/grayscale-ref.tifbin0 -> 256182 bytes
-rw-r--r--tests/shared/images/tiff/grayscale.tifbin0 -> 64162 bytes
-rw-r--r--tests/shared/images/tiff/image.tifbin0 -> 2242 bytes
-rw-r--r--tests/shared/images/tiff/image_100dpi.tifbin0 -> 2242 bytes
-rw-r--r--tests/shared/images/tiff/indexed_orientation_1.tiffbin0 -> 7740 bytes
-rw-r--r--tests/shared/images/tiff/indexed_orientation_2.tiffbin0 -> 9570 bytes
-rw-r--r--tests/shared/images/tiff/indexed_orientation_3.tiffbin0 -> 11392 bytes
-rw-r--r--tests/shared/images/tiff/indexed_orientation_4.tiffbin0 -> 11392 bytes
-rw-r--r--tests/shared/images/tiff/indexed_orientation_5.tiffbin0 -> 11392 bytes
-rw-r--r--tests/shared/images/tiff/indexed_orientation_6.tiffbin0 -> 11392 bytes
-rw-r--r--tests/shared/images/tiff/indexed_orientation_7.tiffbin0 -> 11392 bytes
-rw-r--r--tests/shared/images/tiff/indexed_orientation_8.tiffbin0 -> 11392 bytes
-rw-r--r--tests/shared/images/tiff/mono_orientation_1.tiffbin0 -> 2382 bytes
-rw-r--r--tests/shared/images/tiff/mono_orientation_2.tiffbin0 -> 1608 bytes
-rw-r--r--tests/shared/images/tiff/mono_orientation_3.tiffbin0 -> 1608 bytes
-rw-r--r--tests/shared/images/tiff/mono_orientation_4.tiffbin0 -> 1608 bytes
-rw-r--r--tests/shared/images/tiff/mono_orientation_5.tiffbin0 -> 1608 bytes
-rw-r--r--tests/shared/images/tiff/mono_orientation_6.tiffbin0 -> 1608 bytes
-rw-r--r--tests/shared/images/tiff/mono_orientation_7.tiffbin0 -> 1608 bytes
-rw-r--r--tests/shared/images/tiff/mono_orientation_8.tiffbin0 -> 1608 bytes
-rw-r--r--tests/shared/images/tiff/original_indexed.tiffbin0 -> 5922 bytes
-rw-r--r--tests/shared/images/tiff/original_mono.tiffbin0 -> 786 bytes
-rw-r--r--tests/shared/images/tiff/original_rgb.tiffbin0 -> 12608 bytes
-rw-r--r--tests/shared/images/tiff/rgb_orientation_1.tiffbin0 -> 15560 bytes
-rw-r--r--tests/shared/images/tiff/rgb_orientation_2.tiffbin0 -> 17972 bytes
-rw-r--r--tests/shared/images/tiff/rgb_orientation_3.tiffbin0 -> 17324 bytes
-rw-r--r--tests/shared/images/tiff/rgb_orientation_4.tiffbin0 -> 17324 bytes
-rw-r--r--tests/shared/images/tiff/rgb_orientation_5.tiffbin0 -> 17648 bytes
-rw-r--r--tests/shared/images/tiff/rgb_orientation_6.tiffbin0 -> 17324 bytes
-rw-r--r--tests/shared/images/tiff/rgb_orientation_7.tiffbin0 -> 17324 bytes
-rw-r--r--tests/shared/images/tiff/rgb_orientation_8.tiffbin0 -> 17324 bytes
-rw-r--r--tests/shared/images/tiff/rgba_adobedeflate_littleendian.tifbin0 -> 4784 bytes
-rw-r--r--tests/shared/images/tiff/rgba_lzw_littleendian.tifbin0 -> 26690 bytes
-rw-r--r--tests/shared/images/tiff/rgba_nocompression_bigendian.tifbin0 -> 160384 bytes
-rw-r--r--tests/shared/images/tiff/rgba_nocompression_littleendian.tifbin0 -> 160388 bytes
-rw-r--r--tests/shared/images/tiff/rgba_packbits_littleendian.tifbin0 -> 161370 bytes
-rw-r--r--tests/shared/images/tiff/rgba_zipdeflate_littleendian.tifbin0 -> 14728 bytes
-rw-r--r--tests/shared/images/tiff/teapot.tiffbin0 -> 262274 bytes
47 files changed, 742 insertions, 3 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 5279d05..793221c 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -1,3 +1,3 @@
TEMPLATE = subdirs
SUBDIRS =
-contains(QT_CONFIG, system-zlib): SUBDIRS += mng
+contains(QT_CONFIG, system-zlib): SUBDIRS += mng tiff
diff --git a/tests/auto/tiff/tiff.pro b/tests/auto/tiff/tiff.pro
new file mode 100644
index 0000000..739a5e0
--- /dev/null
+++ b/tests/auto/tiff/tiff.pro
@@ -0,0 +1,11 @@
+TEMPLATE = app
+TARGET = tst_qtiff
+DEPENDPATH += .
+INCLUDEPATH += .
+
+QT = core gui testlib
+CONFIG -= app_bundle
+CONFIG += testcase
+
+SOURCES += tst_qtiff.cpp
+RESOURCES += $$PWD/../../shared/images/tiff.qrc
diff --git a/tests/auto/tiff/tst_qtiff.cpp b/tests/auto/tiff/tst_qtiff.cpp
new file mode 100644
index 0000000..c242ad7
--- /dev/null
+++ b/tests/auto/tiff/tst_qtiff.cpp
@@ -0,0 +1,523 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtAddOn.ImageFormats module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QtGui/QtGui>
+
+Q_DECLARE_METATYPE(QImage::Format)
+Q_DECLARE_METATYPE(QImageWriter::ImageWriterError)
+typedef QList<int> QIntList;
+Q_DECLARE_METATYPE(QIntList)
+
+class tst_qtiff: public QObject
+{
+ Q_OBJECT
+private slots:
+ void initTestCase();
+
+ void formatHandler();
+
+ void readImage_data();
+ void readImage();
+
+ void readCorruptImage_data();
+ void readCorruptImage();
+
+ void tiffCompression_data();
+ void tiffCompression();
+ void tiffEndianness();
+
+ void tiffOrientation_data();
+ void tiffOrientation();
+
+ void tiffGrayscale();
+
+ void dotsPerMeter_data();
+ void dotsPerMeter();
+
+ void physicalDpi_data();
+ void physicalDpi();
+
+ void writeImage_data();
+ void writeImage();
+
+ void readWriteNonDestructive_data();
+ void readWriteNonDestructive();
+
+ void largeTiff();
+
+ void supportsOption_data();
+ void supportsOption();
+
+ void resolution_data();
+ void resolution();
+
+private:
+ QString prefix;
+};
+
+void tst_qtiff::initTestCase()
+{
+ prefix = ":/tiff/";
+}
+
+void tst_qtiff::formatHandler()
+{
+ QString testFormat = "TIFF";
+ QString testFile = prefix + "image.tif";
+ QList<QByteArray> formats = QImageReader::supportedImageFormats();
+
+ bool formatSupported = false;
+ for (QList<QByteArray>::Iterator it = formats.begin(); it != formats.end(); ++it) {
+ if (*it == testFormat.toLower()) {
+ formatSupported = true;
+ break;
+ }
+ }
+ QVERIFY(formatSupported);
+ QCOMPARE(QImageReader::imageFormat(testFile), testFormat.toLatin1().toLower());
+}
+
+void tst_qtiff::readImage_data()
+{
+ QTest::addColumn<QString>("fileName");
+ QTest::addColumn<QSize>("size");
+
+ QTest::newRow("grayscale-ref") << QString("grayscale-ref.tif") << QSize(320, 200);
+ QTest::newRow("grayscale") << QString("grayscale.tif") << QSize(320, 200);
+ QTest::newRow("image_100dpi") << QString("image_100dpi.tif") << QSize(22, 22);
+ QTest::newRow("image") << QString("image.tif") << QSize(22, 22);
+ QTest::newRow("indexed_orientation_1") << QString("indexed_orientation_1.tiff") << QSize(64, 64);
+ QTest::newRow("indexed_orientation_2") << QString("indexed_orientation_2.tiff") << QSize(64, 64);
+ QTest::newRow("indexed_orientation_3") << QString("indexed_orientation_3.tiff") << QSize(64, 64);
+ QTest::newRow("indexed_orientation_4") << QString("indexed_orientation_4.tiff") << QSize(64, 64);
+ QTest::newRow("indexed_orientation_5") << QString("indexed_orientation_5.tiff") << QSize(64, 64);
+ QTest::newRow("indexed_orientation_6") << QString("indexed_orientation_6.tiff") << QSize(64, 64);
+ QTest::newRow("indexed_orientation_7") << QString("indexed_orientation_7.tiff") << QSize(64, 64);
+ QTest::newRow("indexed_orientation_8") << QString("indexed_orientation_8.tiff") << QSize(64, 64);
+ QTest::newRow("mono_orientation_1") << QString("mono_orientation_1.tiff") << QSize(64, 64);
+ QTest::newRow("mono_orientation_2") << QString("mono_orientation_2.tiff") << QSize(64, 64);
+ QTest::newRow("mono_orientation_3") << QString("mono_orientation_3.tiff") << QSize(64, 64);
+ QTest::newRow("mono_orientation_4") << QString("mono_orientation_4.tiff") << QSize(64, 64);
+ QTest::newRow("mono_orientation_5") << QString("mono_orientation_5.tiff") << QSize(64, 64);
+ QTest::newRow("mono_orientation_6") << QString("mono_orientation_6.tiff") << QSize(64, 64);
+ QTest::newRow("mono_orientation_7") << QString("mono_orientation_7.tiff") << QSize(64, 64);
+ QTest::newRow("mono_orientation_8") << QString("mono_orientation_8.tiff") << QSize(64, 64);
+ QTest::newRow("original_indexed") << QString("original_indexed.tiff") << QSize(64, 64);
+ QTest::newRow("original_mono") << QString("original_mono.tiff") << QSize(64, 64);
+ QTest::newRow("original_rgb") << QString("original_rgb.tiff") << QSize(64, 64);
+ QTest::newRow("rgba_adobedeflate_littleendian") << QString("rgba_adobedeflate_littleendian.tif") << QSize(200, 200);
+ QTest::newRow("rgba_lzw_littleendian") << QString("rgba_lzw_littleendian.tif") << QSize(200, 200);
+ QTest::newRow("rgba_nocompression_bigendian") << QString("rgba_nocompression_bigendian.tif") << QSize(200, 200);
+ QTest::newRow("rgba_nocompression_littleendian") << QString("rgba_nocompression_littleendian.tif") << QSize(200, 200);
+ QTest::newRow("rgba_packbits_littleendian") << QString("rgba_packbits_littleendian.tif") << QSize(200, 200);
+ QTest::newRow("rgba_zipdeflate_littleendian") << QString("rgba_zipdeflate_littleendian.tif") << QSize(200, 200);
+ QTest::newRow("rgb_orientation_1") << QString("rgb_orientation_1.tiff") << QSize(64, 64);
+ QTest::newRow("rgb_orientation_2") << QString("rgb_orientation_2.tiff") << QSize(64, 64);
+ QTest::newRow("rgb_orientation_3") << QString("rgb_orientation_3.tiff") << QSize(64, 64);
+ QTest::newRow("rgb_orientation_4") << QString("rgb_orientation_4.tiff") << QSize(64, 64);
+ QTest::newRow("rgb_orientation_5") << QString("rgb_orientation_5.tiff") << QSize(64, 64);
+ QTest::newRow("rgb_orientation_6") << QString("rgb_orientation_6.tiff") << QSize(64, 64);
+ QTest::newRow("rgb_orientation_7") << QString("rgb_orientation_7.tiff") << QSize(64, 64);
+ QTest::newRow("rgb_orientation_8") << QString("rgb_orientation_8.tiff") << QSize(64, 64);
+ QTest::newRow("teapot") << QString("teapot.tiff") << QSize(256, 256);
+}
+
+void tst_qtiff::readImage()
+{
+ QFETCH(QString, fileName);
+ QFETCH(QSize, size);
+
+ QString path = prefix + fileName;
+ QImageReader reader(path);
+ QVERIFY(reader.canRead());
+ QImage image = reader.read();
+ QVERIFY(!image.isNull());
+ QCOMPARE(image.size(), size);
+}
+
+void tst_qtiff::readCorruptImage_data()
+{
+ QTest::addColumn<QString>("fileName");
+ QTest::addColumn<QString>("message");
+
+ QTest::newRow("corrupt tiff") << QString("corrupt-data.tif") << QString();
+}
+
+void tst_qtiff::readCorruptImage()
+{
+ QFETCH(QString, fileName);
+ QFETCH(QString, message);
+
+ QString path = prefix + fileName;
+ QImageReader reader(path);
+ if (!message.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, message.toLatin1());
+ QVERIFY(reader.canRead());
+ QImage image = reader.read();
+ QVERIFY(image.isNull());
+}
+
+void tst_qtiff::tiffCompression_data()
+{
+ QTest::addColumn<QString>("uncompressedFile");
+ QTest::addColumn<QString>("compressedFile");
+
+ QTest::newRow("TIFF: adobedeflate") << "rgba_nocompression_littleendian.tif"
+ << "rgba_adobedeflate_littleendian.tif";
+ QTest::newRow("TIFF: lzw") << "rgba_nocompression_littleendian.tif"
+ << "rgba_lzw_littleendian.tif";
+ QTest::newRow("TIFF: packbits") << "rgba_nocompression_littleendian.tif"
+ << "rgba_packbits_littleendian.tif";
+ QTest::newRow("TIFF: zipdeflate") << "rgba_nocompression_littleendian.tif"
+ << "rgba_zipdeflate_littleendian.tif";
+}
+
+void tst_qtiff::tiffCompression()
+{
+ QFETCH(QString, uncompressedFile);
+ QFETCH(QString, compressedFile);
+
+ QImage uncompressedImage(prefix + uncompressedFile);
+ QImage compressedImage(prefix + compressedFile);
+
+ QCOMPARE(uncompressedImage, compressedImage);
+}
+
+void tst_qtiff::tiffEndianness()
+{
+ QImage littleEndian(prefix + "rgba_nocompression_littleendian.tif");
+ QImage bigEndian(prefix + "rgba_nocompression_bigendian.tif");
+
+ QCOMPARE(littleEndian, bigEndian);
+}
+
+void tst_qtiff::tiffOrientation_data()
+{
+ QTest::addColumn<QString>("expected");
+ QTest::addColumn<QString>("oriented");
+ QTest::newRow("Indexed TIFF, orientation1") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_1.tiff";
+ QTest::newRow("Indexed TIFF, orientation2") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_2.tiff";
+ QTest::newRow("Indexed TIFF, orientation3") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_3.tiff";
+ QTest::newRow("Indexed TIFF, orientation4") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_4.tiff";
+ QTest::newRow("Indexed TIFF, orientation5") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_5.tiff";
+ QTest::newRow("Indexed TIFF, orientation6") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_6.tiff";
+ QTest::newRow("Indexed TIFF, orientation7") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_7.tiff";
+ QTest::newRow("Indexed TIFF, orientation8") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_8.tiff";
+
+ QTest::newRow("Mono TIFF, orientation1") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_1.tiff";
+ QTest::newRow("Mono TIFF, orientation2") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_2.tiff";
+ QTest::newRow("Mono TIFF, orientation3") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_3.tiff";
+ QTest::newRow("Mono TIFF, orientation4") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_4.tiff";
+ QTest::newRow("Mono TIFF, orientation5") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_5.tiff";
+ QTest::newRow("Mono TIFF, orientation6") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_6.tiff";
+ QTest::newRow("Mono TIFF, orientation7") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_7.tiff";
+ QTest::newRow("Mono TIFF, orientation8") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_8.tiff";
+
+ QTest::newRow("RGB TIFF, orientation1") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_1.tiff";
+ QTest::newRow("RGB TIFF, orientation2") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_2.tiff";
+ QTest::newRow("RGB TIFF, orientation3") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_3.tiff";
+ QTest::newRow("RGB TIFF, orientation4") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_4.tiff";
+ QTest::newRow("RGB TIFF, orientation5") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_5.tiff";
+ QTest::newRow("RGB TIFF, orientation6") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_6.tiff";
+ QTest::newRow("RGB TIFF, orientation7") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_7.tiff";
+ QTest::newRow("RGB TIFF, orientation8") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_8.tiff";
+}
+
+void tst_qtiff::tiffOrientation()
+{
+ QFETCH(QString, expected);
+ QFETCH(QString, oriented);
+
+ QImage expectedImage(prefix + expected);
+ QImage orientedImage(prefix + oriented);
+ QCOMPARE(expectedImage, orientedImage);
+}
+
+void tst_qtiff::tiffGrayscale()
+{
+ QImage actualImage(prefix + "grayscale.tif");
+ QImage expectedImage(prefix + "grayscale-ref.tif");
+
+ QCOMPARE(expectedImage, actualImage.convertToFormat(expectedImage.format()));
+}
+
+void tst_qtiff::dotsPerMeter_data()
+{
+ QTest::addColumn<QString>("fileName");
+ QTest::addColumn<int>("expectedDotsPerMeterX");
+ QTest::addColumn<int>("expectedDotsPerMeterY");
+ QTest::newRow("TIFF: 72 dpi") << ("rgba_nocompression_littleendian.tif") << qRound(72 * (100 / 2.54)) << qRound(72 * (100 / 2.54));
+ QTest::newRow("TIFF: 100 dpi") << ("image_100dpi.tif") << qRound(100 * (100 / 2.54)) << qRound(100 * (100 / 2.54));
+}
+
+void tst_qtiff::dotsPerMeter()
+{
+ QFETCH(QString, fileName);
+ QFETCH(int, expectedDotsPerMeterX);
+ QFETCH(int, expectedDotsPerMeterY);
+
+ QImage image(prefix + fileName);
+
+ QCOMPARE(image.dotsPerMeterX(), expectedDotsPerMeterX);
+ QCOMPARE(image.dotsPerMeterY(), expectedDotsPerMeterY);
+}
+
+void tst_qtiff::physicalDpi_data()
+{
+ QTest::addColumn<QString>("fileName");
+ QTest::addColumn<int>("expectedPhysicalDpiX");
+ QTest::addColumn<int>("expectedPhysicalDpiY");
+ QTest::newRow("TIFF: 72 dpi") << "rgba_nocompression_littleendian.tif" << 72 << 72;
+ QTest::newRow("TIFF: 100 dpi") << "image_100dpi.tif" << 100 << 100;
+}
+
+void tst_qtiff::physicalDpi()
+{
+ QFETCH(QString, fileName);
+ QFETCH(int, expectedPhysicalDpiX);
+ QFETCH(int, expectedPhysicalDpiY);
+
+ QImage image(prefix + fileName);
+
+ QCOMPARE(image.physicalDpiX(), expectedPhysicalDpiX);
+ QCOMPARE(image.physicalDpiY(), expectedPhysicalDpiY);
+}
+
+void tst_qtiff::writeImage_data()
+{
+ QTest::addColumn<QString>("fileName");
+ QTest::addColumn<bool>("lossy");
+ QTest::addColumn<QByteArray>("format");
+
+ QTest::newRow("TIFF: teapot") << QString("teapot.tiff") << false << QByteArray("tiff");
+}
+
+void tst_qtiff::writeImage()
+{
+ QFETCH(QString, fileName);
+ QFETCH(bool, lossy);
+ QFETCH(QByteArray, format);
+
+ QImage image;
+ {
+ QImageReader reader(prefix + fileName);
+ image = reader.read();
+ QVERIFY2(!image.isNull(), qPrintable(reader.errorString()));
+ }
+ QByteArray output;
+ {
+ QBuffer buf(&output);
+ QVERIFY(buf.open(QIODevice::WriteOnly));
+ QImageWriter writer(&buf, format);
+ QVERIFY(writer.write(image));
+ }
+
+ QImage image2;
+ {
+ QBuffer buf(&output);
+ QVERIFY(buf.open(QIODevice::ReadOnly));
+ QImageReader reader(&buf);
+ image2 = reader.read();
+ QVERIFY2(!image.isNull(), qPrintable(reader.errorString()));
+ }
+ if (!lossy) {
+ QCOMPARE(image, image2);
+ } else {
+ QCOMPARE(image.format(), image2.format());
+ QCOMPARE(image.depth(), image2.depth());
+ }
+}
+
+void tst_qtiff::readWriteNonDestructive_data()
+{
+ QTest::addColumn<QImage::Format>("format");
+ QTest::addColumn<QImage::Format>("expectedFormat");
+ 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 rgb32") << QImage::Format_ARGB32 << QImage::Format_ARGB32 << false;
+ QTest::newRow("tiff grayscale") << QImage::Format_Indexed8 << QImage::Format_Indexed8 << true;
+}
+
+void tst_qtiff::readWriteNonDestructive()
+{
+ QFETCH(QImage::Format, format);
+ QFETCH(QImage::Format, expectedFormat);
+ QFETCH(bool, grayscale);
+ QImage image = QImage(prefix + "colorful.bmp").convertToFormat(format);
+ QVERIFY(!image.isNull());
+
+ if (grayscale) {
+ QVector<QRgb> colors;
+ for (int i = 0; i < 256; ++i)
+ colors << qRgb(i, i, i);
+ image.setColorTable(colors);
+ }
+
+ QByteArray output;
+ QBuffer buf(&output);
+ QVERIFY(buf.open(QIODevice::WriteOnly));
+ QVERIFY(image.save(&buf, "tiff"));
+ buf.close();
+
+ QVERIFY(buf.open(QIODevice::ReadOnly));
+ QImageReader reader(&buf);
+ QImage image2 = reader.read();
+ QVERIFY2(!image.isNull(), qPrintable(reader.errorString()));
+
+ QImage::Format readFormat = image2.format();
+ QCOMPARE(readFormat, expectedFormat);
+ QCOMPARE(image, image2);
+}
+
+void tst_qtiff::largeTiff()
+{
+#if defined(Q_OS_WINCE)
+ QSKIP("not tested on WinCE");
+#endif
+
+ QImage img(4096, 2048, QImage::Format_ARGB32);
+
+ QPainter p(&img);
+ img.fill(0x0);
+ p.fillRect(0, 0, 4096, 2048, QBrush(Qt::CrossPattern));
+ p.end();
+
+ QByteArray array;
+ QBuffer writeBuffer(&array);
+ writeBuffer.open(QIODevice::WriteOnly);
+
+ QImageWriter writer(&writeBuffer, "tiff");
+ QVERIFY(writer.write(img));
+
+ writeBuffer.close();
+
+ QBuffer readBuffer(&array);
+ readBuffer.open(QIODevice::ReadOnly);
+
+ QImageReader reader(&readBuffer, "tiff");
+
+ QImage img2 = reader.read();
+ QVERIFY(!img2.isNull());
+
+ QCOMPARE(img, img2);
+}
+
+void tst_qtiff::supportsOption_data()
+{
+ QTest::addColumn<QIntList>("options");
+
+ QTest::newRow("tiff") << (QIntList() << QImageIOHandler::Size
+ << QImageIOHandler::CompressionRatio);
+}
+
+void tst_qtiff::supportsOption()
+{
+ QFETCH(QIntList, options);
+
+ QSet<QImageIOHandler::ImageOption> allOptions;
+ allOptions << QImageIOHandler::Size
+ << QImageIOHandler::ClipRect
+ << QImageIOHandler::Description
+ << QImageIOHandler::ScaledClipRect
+ << QImageIOHandler::ScaledSize
+ << QImageIOHandler::CompressionRatio
+ << QImageIOHandler::Gamma
+ << QImageIOHandler::Quality
+ << QImageIOHandler::Name
+ << QImageIOHandler::SubType
+ << QImageIOHandler::IncrementalReading
+ << QImageIOHandler::Endianness
+ << QImageIOHandler::Animation
+ << QImageIOHandler::BackgroundColor;
+
+ QImageWriter writer;
+ writer.setFormat("tiff");
+ for (int i = 0; i < options.size(); ++i) {
+ QVERIFY(writer.supportsOption(QImageIOHandler::ImageOption(options.at(i))));
+ allOptions.remove(QImageIOHandler::ImageOption(options.at(i)));
+ }
+
+ foreach (QImageIOHandler::ImageOption option, allOptions)
+ QVERIFY(!writer.supportsOption(option));
+}
+
+void tst_qtiff::resolution_data()
+{
+ QTest::addColumn<QString>("filename");
+ QTest::addColumn<int>("expectedDotsPerMeterX");
+ QTest::addColumn<int>("expectedDotsPerMeterY");
+
+ QTest::newRow("TIFF: 100 dpi") << ("image_100dpi.tif") << qRound(100 * (100 / 2.54)) << qRound(100 * (100 / 2.54));
+ QTest::newRow("TIFF: 50 dpi") << ("image_50dpi.tif") << qRound(50 * (100 / 2.54)) << qRound(50 * (100 / 2.54));
+ QTest::newRow("TIFF: 300 dot per meter") << ("image_300dpm.tif") << 300 << 300;
+}
+
+void tst_qtiff::resolution()
+{
+ QFETCH(QString, filename);
+ QFETCH(int, expectedDotsPerMeterX);
+ QFETCH(int, expectedDotsPerMeterY);
+
+ QImage image(prefix + QLatin1String("colorful.bmp"));
+ image.setDotsPerMeterX(expectedDotsPerMeterX);
+ image.setDotsPerMeterY(expectedDotsPerMeterY);
+
+ QByteArray output;
+ {
+ QBuffer buf(&output);
+ QVERIFY(buf.open(QIODevice::WriteOnly));
+ QImageWriter writer(&buf, "tiff");
+ QVERIFY(writer.write(image));
+ }
+ QBuffer buf(&output);
+ QVERIFY(buf.open(QIODevice::ReadOnly));
+ QImageReader reader(&buf);
+ const QImage generatedImage = reader.read();
+ QVERIFY(!generatedImage.isNull());
+
+ QCOMPARE(expectedDotsPerMeterX, generatedImage.dotsPerMeterX());
+ QCOMPARE(expectedDotsPerMeterY, generatedImage.dotsPerMeterY());
+}
+
+QTEST_MAIN(tst_qtiff)
+#include "tst_qtiff.moc"
diff --git a/tests/benchmarks/benchmarks.pro b/tests/benchmarks/benchmarks.pro
index bd41748..793221c 100644
--- a/tests/benchmarks/benchmarks.pro
+++ b/tests/benchmarks/benchmarks.pro
@@ -1,3 +1,3 @@
TEMPLATE = subdirs
-SUBDIRS = \
- mng
+SUBDIRS =
+contains(QT_CONFIG, system-zlib): SUBDIRS += mng tiff
diff --git a/tests/benchmarks/tiff/tiff.pro b/tests/benchmarks/tiff/tiff.pro
new file mode 100644
index 0000000..61187d6
--- /dev/null
+++ b/tests/benchmarks/tiff/tiff.pro
@@ -0,0 +1,10 @@
+TEMPLATE = app
+TARGET = tst_bench_qtiff
+DEPENDPATH += .
+INCLUDEPATH += .
+
+QT = core gui testlib
+CONFIG -= app_bundle
+
+SOURCES += tst_qtiff.cpp
+RESOURCES += ../../shared/images/tiff.qrc
diff --git a/tests/benchmarks/tiff/tst_qtiff.cpp b/tests/benchmarks/tiff/tst_qtiff.cpp
new file mode 100644
index 0000000..7b02a4d
--- /dev/null
+++ b/tests/benchmarks/tiff/tst_qtiff.cpp
@@ -0,0 +1,151 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtAddOn.ImageFormats module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QtGui/QtGui>
+
+class tst_qtiff: public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void initTestCase();
+
+ void readImage_data();
+ void readImage();
+ void readCorruptImage_data();
+ void readCorruptImage();
+
+private:
+ QString prefix;
+};
+
+void tst_qtiff::initTestCase()
+{
+ prefix = ":/tiff/";
+}
+
+void tst_qtiff::readImage_data()
+{
+ QTest::addColumn<QString>("fileName");
+ QTest::addColumn<QSize>("size");
+
+ QTest::newRow("grayscale-ref") << QString("grayscale-ref.tif") << QSize(320, 200);
+ QTest::newRow("grayscale") << QString("grayscale.tif") << QSize(320, 200);
+ QTest::newRow("image_100dpi") << QString("image_100dpi.tif") << QSize(22, 22);
+ QTest::newRow("image") << QString("image.tif") << QSize(22, 22);
+ QTest::newRow("indexed_orientation_1") << QString("indexed_orientation_1.tiff") << QSize(64, 64);
+ QTest::newRow("indexed_orientation_2") << QString("indexed_orientation_2.tiff") << QSize(64, 64);
+ QTest::newRow("indexed_orientation_3") << QString("indexed_orientation_3.tiff") << QSize(64, 64);
+ QTest::newRow("indexed_orientation_4") << QString("indexed_orientation_4.tiff") << QSize(64, 64);
+ QTest::newRow("indexed_orientation_5") << QString("indexed_orientation_5.tiff") << QSize(64, 64);
+ QTest::newRow("indexed_orientation_6") << QString("indexed_orientation_6.tiff") << QSize(64, 64);
+ QTest::newRow("indexed_orientation_7") << QString("indexed_orientation_7.tiff") << QSize(64, 64);
+ QTest::newRow("indexed_orientation_8") << QString("indexed_orientation_8.tiff") << QSize(64, 64);
+ QTest::newRow("mono_orientation_1") << QString("mono_orientation_1.tiff") << QSize(64, 64);
+ QTest::newRow("mono_orientation_2") << QString("mono_orientation_2.tiff") << QSize(64, 64);
+ QTest::newRow("mono_orientation_3") << QString("mono_orientation_3.tiff") << QSize(64, 64);
+ QTest::newRow("mono_orientation_4") << QString("mono_orientation_4.tiff") << QSize(64, 64);
+ QTest::newRow("mono_orientation_5") << QString("mono_orientation_5.tiff") << QSize(64, 64);
+ QTest::newRow("mono_orientation_6") << QString("mono_orientation_6.tiff") << QSize(64, 64);
+ QTest::newRow("mono_orientation_7") << QString("mono_orientation_7.tiff") << QSize(64, 64);
+ QTest::newRow("mono_orientation_8") << QString("mono_orientation_8.tiff") << QSize(64, 64);
+ QTest::newRow("original_indexed") << QString("original_indexed.tiff") << QSize(64, 64);
+ QTest::newRow("original_mono") << QString("original_mono.tiff") << QSize(64, 64);
+ QTest::newRow("original_rgb") << QString("original_rgb.tiff") << QSize(64, 64);
+ QTest::newRow("rgba_adobedeflate_littleendian") << QString("rgba_adobedeflate_littleendian.tif") << QSize(200, 200);
+ QTest::newRow("rgba_lzw_littleendian") << QString("rgba_lzw_littleendian.tif") << QSize(200, 200);
+ QTest::newRow("rgba_nocompression_bigendian") << QString("rgba_nocompression_bigendian.tif") << QSize(200, 200);
+ QTest::newRow("rgba_nocompression_littleendian") << QString("rgba_nocompression_littleendian.tif") << QSize(200, 200);
+ QTest::newRow("rgba_packbits_littleendian") << QString("rgba_packbits_littleendian.tif") << QSize(200, 200);
+ QTest::newRow("rgba_zipdeflate_littleendian") << QString("rgba_zipdeflate_littleendian.tif") << QSize(200, 200);
+ QTest::newRow("rgb_orientation_1") << QString("rgb_orientation_1.tiff") << QSize(64, 64);
+ QTest::newRow("rgb_orientation_2") << QString("rgb_orientation_2.tiff") << QSize(64, 64);
+ QTest::newRow("rgb_orientation_3") << QString("rgb_orientation_3.tiff") << QSize(64, 64);
+ QTest::newRow("rgb_orientation_4") << QString("rgb_orientation_4.tiff") << QSize(64, 64);
+ QTest::newRow("rgb_orientation_5") << QString("rgb_orientation_5.tiff") << QSize(64, 64);
+ QTest::newRow("rgb_orientation_6") << QString("rgb_orientation_6.tiff") << QSize(64, 64);
+ QTest::newRow("rgb_orientation_7") << QString("rgb_orientation_7.tiff") << QSize(64, 64);
+ QTest::newRow("rgb_orientation_8") << QString("rgb_orientation_8.tiff") << QSize(64, 64);
+ QTest::newRow("teapot") << QString("teapot.tiff") << QSize(256, 256);
+}
+
+void tst_qtiff::readImage()
+{
+ QFETCH(QString, fileName);
+ QFETCH(QSize, size);
+
+ QString path = prefix + fileName;
+ QBENCHMARK {
+ QImageReader reader(path);
+ QVERIFY(reader.canRead());
+ QImage image = reader.read();
+ QVERIFY(!image.isNull());
+ QCOMPARE(image.size(), size);
+ }
+}
+
+void tst_qtiff::readCorruptImage_data()
+{
+ QTest::addColumn<QString>("fileName");
+ QTest::addColumn<QString>("message");
+
+ QTest::newRow("corrupt-data") << QString("corrupt-data.tif") << QString();
+}
+
+void tst_qtiff::readCorruptImage()
+{
+ QFETCH(QString, fileName);
+ QFETCH(QString, message);
+
+ QString path = prefix + fileName;
+ QBENCHMARK {
+ QImageReader reader(path);
+ if (!message.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, message.toLatin1());
+ QVERIFY(reader.canRead());
+ QImage image = reader.read();
+ QVERIFY(image.isNull());
+ }
+}
+
+QTEST_MAIN(tst_qtiff)
+#include "tst_qtiff.moc"
diff --git a/tests/shared/images/tiff.qrc b/tests/shared/images/tiff.qrc
new file mode 100644
index 0000000..8fcab8b
--- /dev/null
+++ b/tests/shared/images/tiff.qrc
@@ -0,0 +1,44 @@
+<RCC>
+ <qresource prefix="/">
+ <file>tiff/corrupt-data.tif</file>
+ <file>tiff/grayscale-ref.tif</file>
+ <file>tiff/grayscale.tif</file>
+ <file>tiff/image_100dpi.tif</file>
+ <file>tiff/image.tif</file>
+ <file>tiff/indexed_orientation_1.tiff</file>
+ <file>tiff/indexed_orientation_2.tiff</file>
+ <file>tiff/indexed_orientation_3.tiff</file>
+ <file>tiff/indexed_orientation_4.tiff</file>
+ <file>tiff/indexed_orientation_5.tiff</file>
+ <file>tiff/indexed_orientation_6.tiff</file>
+ <file>tiff/indexed_orientation_7.tiff</file>
+ <file>tiff/indexed_orientation_8.tiff</file>
+ <file>tiff/mono_orientation_1.tiff</file>
+ <file>tiff/mono_orientation_2.tiff</file>
+ <file>tiff/mono_orientation_3.tiff</file>
+ <file>tiff/mono_orientation_4.tiff</file>
+ <file>tiff/mono_orientation_5.tiff</file>
+ <file>tiff/mono_orientation_6.tiff</file>
+ <file>tiff/mono_orientation_7.tiff</file>
+ <file>tiff/mono_orientation_8.tiff</file>
+ <file>tiff/original_indexed.tiff</file>
+ <file>tiff/original_mono.tiff</file>
+ <file>tiff/original_rgb.tiff</file>
+ <file>tiff/rgba_adobedeflate_littleendian.tif</file>
+ <file>tiff/rgba_lzw_littleendian.tif</file>
+ <file>tiff/rgba_nocompression_bigendian.tif</file>
+ <file>tiff/rgba_nocompression_littleendian.tif</file>
+ <file>tiff/rgba_packbits_littleendian.tif</file>
+ <file>tiff/rgba_zipdeflate_littleendian.tif</file>
+ <file>tiff/rgb_orientation_1.tiff</file>
+ <file>tiff/rgb_orientation_2.tiff</file>
+ <file>tiff/rgb_orientation_3.tiff</file>
+ <file>tiff/rgb_orientation_4.tiff</file>
+ <file>tiff/rgb_orientation_5.tiff</file>
+ <file>tiff/rgb_orientation_6.tiff</file>
+ <file>tiff/rgb_orientation_7.tiff</file>
+ <file>tiff/rgb_orientation_8.tiff</file>
+ <file>tiff/teapot.tiff</file>
+ <file>tiff/colorful.bmp</file>
+ </qresource>
+</RCC>
diff --git a/tests/shared/images/tiff/colorful.bmp b/tests/shared/images/tiff/colorful.bmp
new file mode 100644
index 0000000..8ea6f4a
--- /dev/null
+++ b/tests/shared/images/tiff/colorful.bmp
Binary files differ
diff --git a/tests/shared/images/tiff/corrupt-data.tif b/tests/shared/images/tiff/corrupt-data.tif
new file mode 100644
index 0000000..d63c688
--- /dev/null
+++ b/tests/shared/images/tiff/corrupt-data.tif
Binary files differ
diff --git a/tests/shared/images/tiff/grayscale-ref.tif b/tests/shared/images/tiff/grayscale-ref.tif
new file mode 100644
index 0000000..960531e
--- /dev/null
+++ b/tests/shared/images/tiff/grayscale-ref.tif
Binary files differ
diff --git a/tests/shared/images/tiff/grayscale.tif b/tests/shared/images/tiff/grayscale.tif
new file mode 100644
index 0000000..5f4e114
--- /dev/null
+++ b/tests/shared/images/tiff/grayscale.tif
Binary files differ
diff --git a/tests/shared/images/tiff/image.tif b/tests/shared/images/tiff/image.tif
new file mode 100644
index 0000000..ee0637c
--- /dev/null
+++ b/tests/shared/images/tiff/image.tif
Binary files differ
diff --git a/tests/shared/images/tiff/image_100dpi.tif b/tests/shared/images/tiff/image_100dpi.tif
new file mode 100644
index 0000000..fcf3cd8
--- /dev/null
+++ b/tests/shared/images/tiff/image_100dpi.tif
Binary files differ
diff --git a/tests/shared/images/tiff/indexed_orientation_1.tiff b/tests/shared/images/tiff/indexed_orientation_1.tiff
new file mode 100644
index 0000000..3fcb8a9
--- /dev/null
+++ b/tests/shared/images/tiff/indexed_orientation_1.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/indexed_orientation_2.tiff b/tests/shared/images/tiff/indexed_orientation_2.tiff
new file mode 100644
index 0000000..6f3e9d5
--- /dev/null
+++ b/tests/shared/images/tiff/indexed_orientation_2.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/indexed_orientation_3.tiff b/tests/shared/images/tiff/indexed_orientation_3.tiff
new file mode 100644
index 0000000..aab9cf2
--- /dev/null
+++ b/tests/shared/images/tiff/indexed_orientation_3.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/indexed_orientation_4.tiff b/tests/shared/images/tiff/indexed_orientation_4.tiff
new file mode 100644
index 0000000..aad96ff
--- /dev/null
+++ b/tests/shared/images/tiff/indexed_orientation_4.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/indexed_orientation_5.tiff b/tests/shared/images/tiff/indexed_orientation_5.tiff
new file mode 100644
index 0000000..05d23dc
--- /dev/null
+++ b/tests/shared/images/tiff/indexed_orientation_5.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/indexed_orientation_6.tiff b/tests/shared/images/tiff/indexed_orientation_6.tiff
new file mode 100644
index 0000000..9ffe7fc
--- /dev/null
+++ b/tests/shared/images/tiff/indexed_orientation_6.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/indexed_orientation_7.tiff b/tests/shared/images/tiff/indexed_orientation_7.tiff
new file mode 100644
index 0000000..eeeb019
--- /dev/null
+++ b/tests/shared/images/tiff/indexed_orientation_7.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/indexed_orientation_8.tiff b/tests/shared/images/tiff/indexed_orientation_8.tiff
new file mode 100644
index 0000000..87cf2fd
--- /dev/null
+++ b/tests/shared/images/tiff/indexed_orientation_8.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/mono_orientation_1.tiff b/tests/shared/images/tiff/mono_orientation_1.tiff
new file mode 100644
index 0000000..3b589b2
--- /dev/null
+++ b/tests/shared/images/tiff/mono_orientation_1.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/mono_orientation_2.tiff b/tests/shared/images/tiff/mono_orientation_2.tiff
new file mode 100644
index 0000000..9a66223
--- /dev/null
+++ b/tests/shared/images/tiff/mono_orientation_2.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/mono_orientation_3.tiff b/tests/shared/images/tiff/mono_orientation_3.tiff
new file mode 100644
index 0000000..eed2423
--- /dev/null
+++ b/tests/shared/images/tiff/mono_orientation_3.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/mono_orientation_4.tiff b/tests/shared/images/tiff/mono_orientation_4.tiff
new file mode 100644
index 0000000..055480e
--- /dev/null
+++ b/tests/shared/images/tiff/mono_orientation_4.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/mono_orientation_5.tiff b/tests/shared/images/tiff/mono_orientation_5.tiff
new file mode 100644
index 0000000..b4d0974
--- /dev/null
+++ b/tests/shared/images/tiff/mono_orientation_5.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/mono_orientation_6.tiff b/tests/shared/images/tiff/mono_orientation_6.tiff
new file mode 100644
index 0000000..3b1e02a
--- /dev/null
+++ b/tests/shared/images/tiff/mono_orientation_6.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/mono_orientation_7.tiff b/tests/shared/images/tiff/mono_orientation_7.tiff
new file mode 100644
index 0000000..b752c74
--- /dev/null
+++ b/tests/shared/images/tiff/mono_orientation_7.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/mono_orientation_8.tiff b/tests/shared/images/tiff/mono_orientation_8.tiff
new file mode 100644
index 0000000..e228d05
--- /dev/null
+++ b/tests/shared/images/tiff/mono_orientation_8.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/original_indexed.tiff b/tests/shared/images/tiff/original_indexed.tiff
new file mode 100644
index 0000000..7507e52
--- /dev/null
+++ b/tests/shared/images/tiff/original_indexed.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/original_mono.tiff b/tests/shared/images/tiff/original_mono.tiff
new file mode 100644
index 0000000..8ff9db8
--- /dev/null
+++ b/tests/shared/images/tiff/original_mono.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/original_rgb.tiff b/tests/shared/images/tiff/original_rgb.tiff
new file mode 100644
index 0000000..321ea3e
--- /dev/null
+++ b/tests/shared/images/tiff/original_rgb.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/rgb_orientation_1.tiff b/tests/shared/images/tiff/rgb_orientation_1.tiff
new file mode 100644
index 0000000..2756a82
--- /dev/null
+++ b/tests/shared/images/tiff/rgb_orientation_1.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/rgb_orientation_2.tiff b/tests/shared/images/tiff/rgb_orientation_2.tiff
new file mode 100644
index 0000000..ae9af09
--- /dev/null
+++ b/tests/shared/images/tiff/rgb_orientation_2.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/rgb_orientation_3.tiff b/tests/shared/images/tiff/rgb_orientation_3.tiff
new file mode 100644
index 0000000..a2f4325
--- /dev/null
+++ b/tests/shared/images/tiff/rgb_orientation_3.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/rgb_orientation_4.tiff b/tests/shared/images/tiff/rgb_orientation_4.tiff
new file mode 100644
index 0000000..f35bfc4
--- /dev/null
+++ b/tests/shared/images/tiff/rgb_orientation_4.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/rgb_orientation_5.tiff b/tests/shared/images/tiff/rgb_orientation_5.tiff
new file mode 100644
index 0000000..70e5478
--- /dev/null
+++ b/tests/shared/images/tiff/rgb_orientation_5.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/rgb_orientation_6.tiff b/tests/shared/images/tiff/rgb_orientation_6.tiff
new file mode 100644
index 0000000..b2635fe
--- /dev/null
+++ b/tests/shared/images/tiff/rgb_orientation_6.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/rgb_orientation_7.tiff b/tests/shared/images/tiff/rgb_orientation_7.tiff
new file mode 100644
index 0000000..1fb0cd9
--- /dev/null
+++ b/tests/shared/images/tiff/rgb_orientation_7.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/rgb_orientation_8.tiff b/tests/shared/images/tiff/rgb_orientation_8.tiff
new file mode 100644
index 0000000..666b1b4
--- /dev/null
+++ b/tests/shared/images/tiff/rgb_orientation_8.tiff
Binary files differ
diff --git a/tests/shared/images/tiff/rgba_adobedeflate_littleendian.tif b/tests/shared/images/tiff/rgba_adobedeflate_littleendian.tif
new file mode 100644
index 0000000..78868b0
--- /dev/null
+++ b/tests/shared/images/tiff/rgba_adobedeflate_littleendian.tif
Binary files differ
diff --git a/tests/shared/images/tiff/rgba_lzw_littleendian.tif b/tests/shared/images/tiff/rgba_lzw_littleendian.tif
new file mode 100644
index 0000000..107eab7
--- /dev/null
+++ b/tests/shared/images/tiff/rgba_lzw_littleendian.tif
Binary files differ
diff --git a/tests/shared/images/tiff/rgba_nocompression_bigendian.tif b/tests/shared/images/tiff/rgba_nocompression_bigendian.tif
new file mode 100644
index 0000000..c314bae
--- /dev/null
+++ b/tests/shared/images/tiff/rgba_nocompression_bigendian.tif
Binary files differ
diff --git a/tests/shared/images/tiff/rgba_nocompression_littleendian.tif b/tests/shared/images/tiff/rgba_nocompression_littleendian.tif
new file mode 100644
index 0000000..4f820f6
--- /dev/null
+++ b/tests/shared/images/tiff/rgba_nocompression_littleendian.tif
Binary files differ
diff --git a/tests/shared/images/tiff/rgba_packbits_littleendian.tif b/tests/shared/images/tiff/rgba_packbits_littleendian.tif
new file mode 100644
index 0000000..ddeec38
--- /dev/null
+++ b/tests/shared/images/tiff/rgba_packbits_littleendian.tif
Binary files differ
diff --git a/tests/shared/images/tiff/rgba_zipdeflate_littleendian.tif b/tests/shared/images/tiff/rgba_zipdeflate_littleendian.tif
new file mode 100644
index 0000000..50a3024
--- /dev/null
+++ b/tests/shared/images/tiff/rgba_zipdeflate_littleendian.tif
Binary files differ
diff --git a/tests/shared/images/tiff/teapot.tiff b/tests/shared/images/tiff/teapot.tiff
new file mode 100644
index 0000000..20845c6
--- /dev/null
+++ b/tests/shared/images/tiff/teapot.tiff
Binary files differ