Skip to content
Snippets Groups Projects
Commit 5a08f5b7 authored by Julien (jvoisin) Voisin's avatar Julien (jvoisin) Voisin
Browse files

Add a test for tiff lightweight cleaning

parent fe885bab
No related branches found
No related tags found
No related merge requests found
...@@ -80,3 +80,27 @@ class TestLightWeightCleaning(unittest.TestCase): ...@@ -80,3 +80,27 @@ class TestLightWeightCleaning(unittest.TestCase):
os.remove('./tests/data/clean.torrent') os.remove('./tests/data/clean.torrent')
os.remove('./tests/data/clean.cleaned.torrent') os.remove('./tests/data/clean.cleaned.torrent')
def test_tiff(self):
shutil.copy('./tests/data/dirty.tiff', './tests/data/clean.tiff')
p = images.TiffParser('./tests/data/clean.tiff')
meta = p.get_meta()
self.assertEqual(meta['ImageDescription'], 'OLYMPUS DIGITAL CAMERA ')
p.lightweight_cleaning = True
ret = p.remove_all()
self.assertTrue(ret)
p = images.TiffParser('./tests/data/clean.cleaned.tiff')
self.assertEqual(p.get_meta(),
{
'Orientation': 'Horizontal (normal)',
'ResolutionUnit': 'inches',
'XResolution': 72,
'YResolution': 72
}
)
os.remove('./tests/data/clean.tiff')
os.remove('./tests/data/clean.cleaned.tiff')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment