Merge branch 'issue230' into devel
This commit is contained in:
commit
b7e2770a5a
2 changed files with 7 additions and 1 deletions
|
|
@ -37,7 +37,9 @@ def tiff_header(read_buffer):
|
||||||
# big endian
|
# big endian
|
||||||
endian = '>'
|
endian = '>'
|
||||||
else:
|
else:
|
||||||
msg = "Bad byte order indication: {0}".format(read_buffer[6:8])
|
msg = "The byte order indication in the TIFF header ({0}) is invalid. "
|
||||||
|
msg += "It should be either {1} or {2}."
|
||||||
|
msg = msg.format(read_buffer[6:8], bytes([73, 73]), bytes([77, 77]))
|
||||||
raise IOError(msg)
|
raise IOError(msg)
|
||||||
|
|
||||||
_, offset = struct.unpack(endian + 'HI', read_buffer[8:14])
|
_, offset = struct.unpack(endian + 'HI', read_buffer[8:14])
|
||||||
|
|
|
||||||
|
|
@ -167,6 +167,10 @@ class TestUUIDExif(unittest.TestCase):
|
||||||
warnings.simplefilter('always')
|
warnings.simplefilter('always')
|
||||||
j = glymur.Jp2k(tfile.name)
|
j = glymur.Jp2k(tfile.name)
|
||||||
self.assertTrue(issubclass(w[0].category, UserWarning))
|
self.assertTrue(issubclass(w[0].category, UserWarning))
|
||||||
|
msg = 'The byte order indication in the TIFF header '
|
||||||
|
msg += "(b'JI') is invalid. "
|
||||||
|
msg += "It should be either b'II' or b'MM'."
|
||||||
|
self.assertTrue(msg in str(w[0].message))
|
||||||
|
|
||||||
self.assertEqual(j.box[-1].box_id, 'uuid')
|
self.assertEqual(j.box[-1].box_id, 'uuid')
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue