Skip to content

Commit

Permalink
image/tif -> image/tiff
Browse files Browse the repository at this point in the history
  • Loading branch information
kba committed Jun 4, 2018
1 parent d7241d2 commit f37dcfd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ocrd/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def add_files_to_mets(self, convention, mets, directory):
fileGrp + '_' + upper(Basename of file without extension) == mets:file @ID
File in root folder == mets:fileGrp @USE == 'OCR-D-IMG'
Extension ==> mets.file @MIMETYPE
.tif => image/tif
.tif => image/tiff
.png => image/png
.jpg => image/jpg
.xml => image/xml
Expand Down
2 changes: 1 addition & 1 deletion ocrd/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def _validate_mets_unique_identifier(self):
self.report.add_error("METS has no unique identifier")

def _validate_pixel_density(self):
for f in self.mets.find_files(mimetype='image/tif'):
for f in self.mets.find_files(mimetype='image/tiff'):
exif = self.workspace.resolve_image_exif(f.url)
for k in ['xResolution', 'yResolution']:
v = exif.__dict__.get(k)
Expand Down
2 changes: 1 addition & 1 deletion test/model/test_ocrd_mets.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_file_groups(self):
def test_find_files(self):
self.assertEqual(len(self.mets.find_files(fileGrp='OCR-D-IMG')), 2, '2 files in "OCR-D-IMG"')
self.assertEqual(len(self.mets.find_files(groupId='FILE_0001_IMAGE')), 17, '17 files with GROUPID "FILE_0001_IMAGE"')
self.assertEqual(len(self.mets.find_files(mimetype='image/tif')), 12, '12 image/tif')
self.assertEqual(len(self.mets.find_files(mimetype='image/tiff')), 12, '12 image/tiff')
self.assertEqual(len(self.mets.find_files(mimetype=MIMETYPE_PAGE)), 20, '20 ' + MIMETYPE_PAGE)
self.assertEqual(len(self.mets.find_files()), 34, '34 files total')

Expand Down
4 changes: 2 additions & 2 deletions test/model/test_ocrd_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ def setUp(self):
def test_from_file(self):
f = ocrd_file.OcrdFile(
None,
mimetype='image/tif',
mimetype='image/tiff',
local_filename=assets.path_to('kant_aufklaerung_1784/kant_aufklaerung_1784_0017.tif')
)
self.assertEqual(f.mimetype, 'image/tif')
self.assertEqual(f.mimetype, 'image/tiff')
p = ocrd_page.from_file(f)
self.assertEqual(p.get_Page().imageWidth, 1457)

Expand Down

0 comments on commit f37dcfd

Please sign in to comment.