From f68a3dc48d8fb8c04fe49dd9e5d07d7cdd221ad1 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Tue, 31 Jan 2012 07:01:22 +0100 Subject: Add TIFF plugin Moved out from qtbase. Task-number: QTBUG-23887 Change-Id: I57d30173e6624d41dba1610084a7ed949ae84d1d Reviewed-by: aavit Sanity-Review: Kent Hansen --- tests/auto/auto.pro | 2 +- tests/auto/tiff/tiff.pro | 11 + tests/auto/tiff/tst_qtiff.cpp | 523 +++++++++++++++++++++ tests/benchmarks/benchmarks.pro | 4 +- tests/benchmarks/tiff/tiff.pro | 10 + tests/benchmarks/tiff/tst_qtiff.cpp | 151 ++++++ tests/shared/images/tiff.qrc | 44 ++ tests/shared/images/tiff/colorful.bmp | Bin 0 -> 65002 bytes tests/shared/images/tiff/corrupt-data.tif | Bin 0 -> 8590 bytes tests/shared/images/tiff/grayscale-ref.tif | Bin 0 -> 256182 bytes tests/shared/images/tiff/grayscale.tif | Bin 0 -> 64162 bytes tests/shared/images/tiff/image.tif | Bin 0 -> 2242 bytes tests/shared/images/tiff/image_100dpi.tif | Bin 0 -> 2242 bytes .../shared/images/tiff/indexed_orientation_1.tiff | Bin 0 -> 7740 bytes .../shared/images/tiff/indexed_orientation_2.tiff | Bin 0 -> 9570 bytes .../shared/images/tiff/indexed_orientation_3.tiff | Bin 0 -> 11392 bytes .../shared/images/tiff/indexed_orientation_4.tiff | Bin 0 -> 11392 bytes .../shared/images/tiff/indexed_orientation_5.tiff | Bin 0 -> 11392 bytes .../shared/images/tiff/indexed_orientation_6.tiff | Bin 0 -> 11392 bytes .../shared/images/tiff/indexed_orientation_7.tiff | Bin 0 -> 11392 bytes .../shared/images/tiff/indexed_orientation_8.tiff | Bin 0 -> 11392 bytes tests/shared/images/tiff/mono_orientation_1.tiff | Bin 0 -> 2382 bytes tests/shared/images/tiff/mono_orientation_2.tiff | Bin 0 -> 1608 bytes tests/shared/images/tiff/mono_orientation_3.tiff | Bin 0 -> 1608 bytes tests/shared/images/tiff/mono_orientation_4.tiff | Bin 0 -> 1608 bytes tests/shared/images/tiff/mono_orientation_5.tiff | Bin 0 -> 1608 bytes tests/shared/images/tiff/mono_orientation_6.tiff | Bin 0 -> 1608 bytes tests/shared/images/tiff/mono_orientation_7.tiff | Bin 0 -> 1608 bytes tests/shared/images/tiff/mono_orientation_8.tiff | Bin 0 -> 1608 bytes tests/shared/images/tiff/original_indexed.tiff | Bin 0 -> 5922 bytes tests/shared/images/tiff/original_mono.tiff | Bin 0 -> 786 bytes tests/shared/images/tiff/original_rgb.tiff | Bin 0 -> 12608 bytes tests/shared/images/tiff/rgb_orientation_1.tiff | Bin 0 -> 15560 bytes tests/shared/images/tiff/rgb_orientation_2.tiff | Bin 0 -> 17972 bytes tests/shared/images/tiff/rgb_orientation_3.tiff | Bin 0 -> 17324 bytes tests/shared/images/tiff/rgb_orientation_4.tiff | Bin 0 -> 17324 bytes tests/shared/images/tiff/rgb_orientation_5.tiff | Bin 0 -> 17648 bytes tests/shared/images/tiff/rgb_orientation_6.tiff | Bin 0 -> 17324 bytes tests/shared/images/tiff/rgb_orientation_7.tiff | Bin 0 -> 17324 bytes tests/shared/images/tiff/rgb_orientation_8.tiff | Bin 0 -> 17324 bytes .../images/tiff/rgba_adobedeflate_littleendian.tif | Bin 0 -> 4784 bytes tests/shared/images/tiff/rgba_lzw_littleendian.tif | Bin 0 -> 26690 bytes .../images/tiff/rgba_nocompression_bigendian.tif | Bin 0 -> 160384 bytes .../tiff/rgba_nocompression_littleendian.tif | Bin 0 -> 160388 bytes .../images/tiff/rgba_packbits_littleendian.tif | Bin 0 -> 161370 bytes .../images/tiff/rgba_zipdeflate_littleendian.tif | Bin 0 -> 14728 bytes tests/shared/images/tiff/teapot.tiff | Bin 0 -> 262274 bytes 47 files changed, 742 insertions(+), 3 deletions(-) create mode 100644 tests/auto/tiff/tiff.pro create mode 100644 tests/auto/tiff/tst_qtiff.cpp create mode 100644 tests/benchmarks/tiff/tiff.pro create mode 100644 tests/benchmarks/tiff/tst_qtiff.cpp create mode 100644 tests/shared/images/tiff.qrc create mode 100644 tests/shared/images/tiff/colorful.bmp create mode 100644 tests/shared/images/tiff/corrupt-data.tif create mode 100644 tests/shared/images/tiff/grayscale-ref.tif create mode 100644 tests/shared/images/tiff/grayscale.tif create mode 100644 tests/shared/images/tiff/image.tif create mode 100644 tests/shared/images/tiff/image_100dpi.tif create mode 100644 tests/shared/images/tiff/indexed_orientation_1.tiff create mode 100644 tests/shared/images/tiff/indexed_orientation_2.tiff create mode 100644 tests/shared/images/tiff/indexed_orientation_3.tiff create mode 100644 tests/shared/images/tiff/indexed_orientation_4.tiff create mode 100644 tests/shared/images/tiff/indexed_orientation_5.tiff create mode 100644 tests/shared/images/tiff/indexed_orientation_6.tiff create mode 100644 tests/shared/images/tiff/indexed_orientation_7.tiff create mode 100644 tests/shared/images/tiff/indexed_orientation_8.tiff create mode 100644 tests/shared/images/tiff/mono_orientation_1.tiff create mode 100644 tests/shared/images/tiff/mono_orientation_2.tiff create mode 100644 tests/shared/images/tiff/mono_orientation_3.tiff create mode 100644 tests/shared/images/tiff/mono_orientation_4.tiff create mode 100644 tests/shared/images/tiff/mono_orientation_5.tiff create mode 100644 tests/shared/images/tiff/mono_orientation_6.tiff create mode 100644 tests/shared/images/tiff/mono_orientation_7.tiff create mode 100644 tests/shared/images/tiff/mono_orientation_8.tiff create mode 100644 tests/shared/images/tiff/original_indexed.tiff create mode 100644 tests/shared/images/tiff/original_mono.tiff create mode 100644 tests/shared/images/tiff/original_rgb.tiff create mode 100644 tests/shared/images/tiff/rgb_orientation_1.tiff create mode 100644 tests/shared/images/tiff/rgb_orientation_2.tiff create mode 100644 tests/shared/images/tiff/rgb_orientation_3.tiff create mode 100644 tests/shared/images/tiff/rgb_orientation_4.tiff create mode 100644 tests/shared/images/tiff/rgb_orientation_5.tiff create mode 100644 tests/shared/images/tiff/rgb_orientation_6.tiff create mode 100644 tests/shared/images/tiff/rgb_orientation_7.tiff create mode 100644 tests/shared/images/tiff/rgb_orientation_8.tiff create mode 100644 tests/shared/images/tiff/rgba_adobedeflate_littleendian.tif create mode 100644 tests/shared/images/tiff/rgba_lzw_littleendian.tif create mode 100644 tests/shared/images/tiff/rgba_nocompression_bigendian.tif create mode 100644 tests/shared/images/tiff/rgba_nocompression_littleendian.tif create mode 100644 tests/shared/images/tiff/rgba_packbits_littleendian.tif create mode 100644 tests/shared/images/tiff/rgba_zipdeflate_littleendian.tif create mode 100644 tests/shared/images/tiff/teapot.tiff (limited to 'tests') 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 +#include + +Q_DECLARE_METATYPE(QImage::Format) +Q_DECLARE_METATYPE(QImageWriter::ImageWriterError) +typedef QList 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 formats = QImageReader::supportedImageFormats(); + + bool formatSupported = false; + for (QList::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("fileName"); + QTest::addColumn("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("fileName"); + QTest::addColumn("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("uncompressedFile"); + QTest::addColumn("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("expected"); + QTest::addColumn("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("fileName"); + QTest::addColumn("expectedDotsPerMeterX"); + QTest::addColumn("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("fileName"); + QTest::addColumn("expectedPhysicalDpiX"); + QTest::addColumn("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("fileName"); + QTest::addColumn("lossy"); + QTest::addColumn("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("format"); + QTest::addColumn("expectedFormat"); + QTest::addColumn("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 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("options"); + + QTest::newRow("tiff") << (QIntList() << QImageIOHandler::Size + << QImageIOHandler::CompressionRatio); +} + +void tst_qtiff::supportsOption() +{ + QFETCH(QIntList, options); + + QSet 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("filename"); + QTest::addColumn("expectedDotsPerMeterX"); + QTest::addColumn("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 +#include + +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("fileName"); + QTest::addColumn("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("fileName"); + QTest::addColumn("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 @@ + + + tiff/corrupt-data.tif + tiff/grayscale-ref.tif + tiff/grayscale.tif + tiff/image_100dpi.tif + tiff/image.tif + tiff/indexed_orientation_1.tiff + tiff/indexed_orientation_2.tiff + tiff/indexed_orientation_3.tiff + tiff/indexed_orientation_4.tiff + tiff/indexed_orientation_5.tiff + tiff/indexed_orientation_6.tiff + tiff/indexed_orientation_7.tiff + tiff/indexed_orientation_8.tiff + tiff/mono_orientation_1.tiff + tiff/mono_orientation_2.tiff + tiff/mono_orientation_3.tiff + tiff/mono_orientation_4.tiff + tiff/mono_orientation_5.tiff + tiff/mono_orientation_6.tiff + tiff/mono_orientation_7.tiff + tiff/mono_orientation_8.tiff + tiff/original_indexed.tiff + tiff/original_mono.tiff + tiff/original_rgb.tiff + tiff/rgba_adobedeflate_littleendian.tif + tiff/rgba_lzw_littleendian.tif + tiff/rgba_nocompression_bigendian.tif + tiff/rgba_nocompression_littleendian.tif + tiff/rgba_packbits_littleendian.tif + tiff/rgba_zipdeflate_littleendian.tif + tiff/rgb_orientation_1.tiff + tiff/rgb_orientation_2.tiff + tiff/rgb_orientation_3.tiff + tiff/rgb_orientation_4.tiff + tiff/rgb_orientation_5.tiff + tiff/rgb_orientation_6.tiff + tiff/rgb_orientation_7.tiff + tiff/rgb_orientation_8.tiff + tiff/teapot.tiff + tiff/colorful.bmp + + diff --git a/tests/shared/images/tiff/colorful.bmp b/tests/shared/images/tiff/colorful.bmp new file mode 100644 index 0000000..8ea6f4a Binary files /dev/null and b/tests/shared/images/tiff/colorful.bmp 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 Binary files /dev/null and b/tests/shared/images/tiff/corrupt-data.tif 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 Binary files /dev/null and b/tests/shared/images/tiff/grayscale-ref.tif differ diff --git a/tests/shared/images/tiff/grayscale.tif b/tests/shared/images/tiff/grayscale.tif new file mode 100644 index 0000000..5f4e114 Binary files /dev/null and b/tests/shared/images/tiff/grayscale.tif differ diff --git a/tests/shared/images/tiff/image.tif b/tests/shared/images/tiff/image.tif new file mode 100644 index 0000000..ee0637c Binary files /dev/null and b/tests/shared/images/tiff/image.tif 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 Binary files /dev/null and b/tests/shared/images/tiff/image_100dpi.tif 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 Binary files /dev/null and b/tests/shared/images/tiff/indexed_orientation_1.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/indexed_orientation_2.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/indexed_orientation_3.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/indexed_orientation_4.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/indexed_orientation_5.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/indexed_orientation_6.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/indexed_orientation_7.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/indexed_orientation_8.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/mono_orientation_1.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/mono_orientation_2.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/mono_orientation_3.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/mono_orientation_4.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/mono_orientation_5.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/mono_orientation_6.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/mono_orientation_7.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/mono_orientation_8.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/original_indexed.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/original_mono.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/original_rgb.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/rgb_orientation_1.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/rgb_orientation_2.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/rgb_orientation_3.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/rgb_orientation_4.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/rgb_orientation_5.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/rgb_orientation_6.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/rgb_orientation_7.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/rgb_orientation_8.tiff 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 Binary files /dev/null and b/tests/shared/images/tiff/rgba_adobedeflate_littleendian.tif 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 Binary files /dev/null and b/tests/shared/images/tiff/rgba_lzw_littleendian.tif 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 Binary files /dev/null and b/tests/shared/images/tiff/rgba_nocompression_bigendian.tif 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 Binary files /dev/null and b/tests/shared/images/tiff/rgba_nocompression_littleendian.tif 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 Binary files /dev/null and b/tests/shared/images/tiff/rgba_packbits_littleendian.tif 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 Binary files /dev/null and b/tests/shared/images/tiff/rgba_zipdeflate_littleendian.tif differ diff --git a/tests/shared/images/tiff/teapot.tiff b/tests/shared/images/tiff/teapot.tiff new file mode 100644 index 0000000..20845c6 Binary files /dev/null and b/tests/shared/images/tiff/teapot.tiff differ -- cgit v1.2.1