diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2010-11-28 20:11:18 +0100 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2010-11-28 20:11:18 +0100 |
commit | 1f3f34118c814770a22f11e6e126ea3da534b194 (patch) | |
tree | 5bd77a090a95e09d29005682bf544898bc744961 | |
parent | 17689217344b7875fd2e701035e814e172af9630 (diff) | |
download | pyexiv2-1f3f34118c814770a22f11e6e126ea3da534b194.tar.gz |
Added a unit test to check that the EXIF thumbnail corresponds to a preview.
-rw-r--r-- | test/metadata.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/metadata.py b/test/metadata.py index a23abb9..a4994d4 100644 --- a/test/metadata.py +++ b/test/metadata.py @@ -741,3 +741,16 @@ class TestImageMetadata(unittest.TestCase): self.failUnlessRaises(IOError, thumb.set_from_file, pathname) self._test_thumbnail_tags(False) + def test_exif_thumbnail_is_preview(self): + self.metadata.read() + self._test_thumbnail_tags(False) + self.assertEqual(len(self.metadata.previews), 0) + thumb = self.metadata.exif_thumbnail + thumb.data = EMPTY_JPG_DATA + self._test_thumbnail_tags(True) + self.assertEqual(len(self.metadata.previews), 1) + preview = self.metadata.previews[0] + self.assertEqual(thumb.mime_type, preview.mime_type) + self.assertEqual(thumb.extension, preview.extension) + self.assertEqual(thumb.data, preview.data) + |