diff --git a/glymur/_uuid_io/Exif.py b/glymur/_uuid_io/Exif.py index ccc03dd..fb5e2a1 100644 --- a/glymur/_uuid_io/Exif.py +++ b/glymur/_uuid_io/Exif.py @@ -34,8 +34,8 @@ class UUIDExif(object): self.read_buffer = read_buffer # Ignore the first six bytes. - # Next 8 should be (73, 73, 42, 8) - data = struct.unpack('I4s', 52, b'uuid')) + tfile.write(b'JpgTiffExif->JP2') + + tfile.write(b'Exif\x00\x00') + xbuffer = struct.pack('>BBHI', 77, 77, 42, 8) + tfile.write(xbuffer) + + # We will write just a single tag. + tfile.write(struct.pack('>H', 1)) + + # The "Make" tag is tag no. 271. + tfile.write(struct.pack('>HHI4s', 271, 2, 3, b'HTC\x00')) + tfile.flush() + + jp2 = glymur.Jp2k(tfile.name) + self.assertEqual(jp2.box[-1].data.ifds['Image']['Make'], "HTC") + if __name__ == "__main__": unittest.main()