summaryrefslogtreecommitdiffstats
path: root/tests/auto/qimagereader
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2009-08-17 16:12:12 +0200
committerBenjamin Poulain <benjamin.poulain@nokia.com>2009-08-17 16:16:36 +0200
commitac9f56b31dacc35dd2007caee69a9cf521ed8410 (patch)
tree4c945b9c487fcef33e8385420b0a2f5cfa6d22ca /tests/auto/qimagereader
parentb31244b59396abea08254cb649eb1f59b2f8ed55 (diff)
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 0000000000..3fcb8a9aca
--- /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 0000000000..6f3e9d5297
--- /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 0000000000..aab9cf2596
--- /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 0000000000..aad96ffc6c
--- /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 0000000000..05d23dcb86
--- /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 0000000000..9ffe7fcaa4
--- /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 0000000000..eeeb01937e
--- /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 0000000000..87cf2fd774
--- /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 0000000000..3b589b2232
--- /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 0000000000..9a662239db
--- /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 0000000000..eed242388c
--- /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 0000000000..055480e0ca
--- /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 0000000000..b4d0974ec8
--- /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 0000000000..3b1e02af56
--- /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 0000000000..b752c745c3
--- /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 0000000000..e228d05659
--- /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 0000000000..7507e526a5
--- /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 0000000000..8ff9db80f5
--- /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 0000000000..321ea3ebf5
--- /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 0000000000..2756a82fbb
--- /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 0000000000..ae9af0999d
--- /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 0000000000..a2f432526b
--- /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 0000000000..f35bfc4c9c
--- /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 0000000000..70e5478065
--- /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 0000000000..b2635fe14f
--- /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 0000000000..1fb0cd9df6
--- /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 0000000000..666b1b4c55
--- /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 dad771b24b..ba3d83e379 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()