def test_wrong_tif(self): shutil.copy('./tests/data/dirty.tiff', './tests/data/clean.tif') p = images.TiffParser('./tests/data/clean.tif') p.remove_all() p = images.TiffParser('./tests/data/clean.cleaned.tif') self.assertEqual(p.get_meta(), {}) os.remove('./tests/data/clean.tif') os.remove('./tests/data/clean.cleaned.tif')
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['Model'], 'C7070WZ') ret = p.remove_all() self.assertTrue(ret) p = images.TiffParser('./tests/data/clean.cleaned.tiff') self.assertEqual(p.get_meta(), {}) self.assertTrue(p.remove_all()) os.remove('./tests/data/clean.tiff') os.remove('./tests/data/clean.cleaned.tiff') os.remove('./tests/data/clean.cleaned.cleaned.tiff')
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')
def test_tiff(self): p = images.TiffParser('./tests/data/dirty.tiff') meta = p.get_meta() self.assertEqual(meta['Make'], 'OLYMPUS IMAGING CORP.') self.assertEqual(meta['Model'], 'C7070WZ') self.assertEqual(meta['ModifyDate'], '2005:12:26 17:09:35')