summaryrefslogtreecommitdiffstats
path: root/tests/auto/qimagereader
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2009-08-17 14:12:12 (GMT)
committerBenjamin Poulain <benjamin.poulain@nokia.com>2009-08-17 14:16:36 (GMT)
commitac9f56b31dacc35dd2007caee69a9cf521ed8410 (patch)
tree4c945b9c487fcef33e8385420b0a2f5cfa6d22ca /tests/auto/qimagereader
parentb31244b59396abea08254cb649eb1f59b2f8ed55 (diff)
downloadQt-ac9f56b31dacc35dd2007caee69a9cf521ed8410.zip
Qt-ac9f56b31dacc35dd2007caee69a9cf521ed8410.tar.gz
Qt-ac9f56b31dacc35dd2007caee69a9cf521ed8410.tar.bz2
Add support for the orientation of tiff images
The orientation tag was ignored for tiff images. The tag is now used to rotate the image before providing it to the user. The orientation of indexed an mono images is done completely manually. The orientation of other type is done in conjunction to the mirroring already performed by libtiff. Task-number: 258526 Reviewed-by: Samuel Rødal
Diffstat (limited to 'tests/auto/qimagereader')
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_1.tiffbin0 -> 7740 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_2.tiffbin0 -> 9570 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_3.tiffbin0 -> 11392 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_4.tiffbin0 -> 11392 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_5.tiffbin0 -> 11392 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_6.tiffbin0 -> 11392 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_7.tiffbin0 -> 11392 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_8.tiffbin0 -> 11392 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_1.tiffbin0 -> 2382 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_2.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_3.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_4.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_5.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_6.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_7.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_8.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/original_indexed.tiffbin0 -> 5922 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/original_mono.tiffbin0 -> 786 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/original_rgb.tiffbin0 -> 12608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_1.tiffbin0 -> 15560 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_2.tiffbin0 -> 17972 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_3.tiffbin0 -> 17324 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_4.tiffbin0 -> 17324 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_5.tiffbin0 -> 17648 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_6.tiffbin0 -> 17324 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_7.tiffbin0 -> 17324 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_8.tiffbin0 -> 17324 bytes
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp45
28 files changed, 45 insertions, 0 deletions
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_1.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_1.tiff
new file mode 100644
index 0000000..3fcb8a9
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_1.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_2.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_2.tiff
new file mode 100644
index 0000000..6f3e9d5
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_2.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_3.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_3.tiff
new file mode 100644
index 0000000..aab9cf2
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_3.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_4.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_4.tiff
new file mode 100644
index 0000000..aad96ff
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_4.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_5.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_5.tiff
new file mode 100644
index 0000000..05d23dc
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_5.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_6.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_6.tiff
new file mode 100644
index 0000000..9ffe7fc
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_6.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_7.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_7.tiff
new file mode 100644
index 0000000..eeeb019
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_7.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_8.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_8.tiff
new file mode 100644
index 0000000..87cf2fd
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_8.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_1.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_1.tiff
new file mode 100644
index 0000000..3b589b2
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_1.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_2.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_2.tiff
new file mode 100644
index 0000000..9a66223
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_2.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_3.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_3.tiff
new file mode 100644
index 0000000..eed2423
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_3.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_4.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_4.tiff
new file mode 100644
index 0000000..055480e
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_4.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_5.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_5.tiff
new file mode 100644
index 0000000..b4d0974
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_5.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_6.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_6.tiff
new file mode 100644
index 0000000..3b1e02a
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_6.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_7.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_7.tiff
new file mode 100644
index 0000000..b752c74
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_7.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_8.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_8.tiff
new file mode 100644
index 0000000..e228d05
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_8.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/original_indexed.tiff b/tests/auto/qimagereader/images/tiff_oriented/original_indexed.tiff
new file mode 100644
index 0000000..7507e52
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/original_indexed.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/original_mono.tiff b/tests/auto/qimagereader/images/tiff_oriented/original_mono.tiff
new file mode 100644
index 0000000..8ff9db8
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/original_mono.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/original_rgb.tiff b/tests/auto/qimagereader/images/tiff_oriented/original_rgb.tiff
new file mode 100644
index 0000000..321ea3e
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/original_rgb.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_1.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_1.tiff
new file mode 100644
index 0000000..2756a82
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_1.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_2.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_2.tiff
new file mode 100644
index 0000000..ae9af09
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_2.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_3.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_3.tiff
new file mode 100644
index 0000000..a2f4325
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_3.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_4.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_4.tiff
new file mode 100644
index 0000000..f35bfc4
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_4.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_5.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_5.tiff
new file mode 100644
index 0000000..70e5478
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_5.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_6.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_6.tiff
new file mode 100644
index 0000000..b2635fe
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_6.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_7.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_7.tiff
new file mode 100644
index 0000000..1fb0cd9
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_7.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_8.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_8.tiff
new file mode 100644
index 0000000..666b1b4
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_8.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index dad771b..ba3d83e 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -149,6 +149,9 @@ private slots:
void tiffCompression_data();
void tiffCompression();
void tiffEndianness();
+
+ void tiffOrientation_data();
+ void tiffOrientation();
#endif
void autoDetectImageFormat();
@@ -1308,6 +1311,48 @@ void tst_QImageReader::tiffEndianness()
QCOMPARE(littleEndian, bigEndian);
}
+void tst_QImageReader::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_QImageReader::tiffOrientation()
+{
+ QFETCH(QString, expected);
+ QFETCH(QString, oriented);
+
+ QImage expectedImage(prefix + expected);
+ QImage orientedImage(prefix + oriented);
+ QCOMPARE(expectedImage, orientedImage);
+}
+
#endif
void tst_QImageReader::dotsPerMeter_data()