mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Added MP Format Version when saving
This commit is contained in:
parent
b617943dca
commit
af317a696d
|
@ -268,6 +268,7 @@ def test_save_all():
|
|||
im_reloaded = roundtrip(im, save_all=True, append_images=[im2])
|
||||
|
||||
assert_image_equal(im, im_reloaded)
|
||||
assert im_reloaded.mpinfo[45056] == b"0100"
|
||||
|
||||
im_reloaded.seek(1)
|
||||
assert_image_similar(im2, im_reloaded, 1)
|
||||
|
|
|
@ -51,7 +51,7 @@ def _save_all(im, fp, filename):
|
|||
if not offsets:
|
||||
# APP2 marker
|
||||
im.encoderinfo["extra"] = (
|
||||
b"\xFF\xE2" + struct.pack(">H", 6 + 70) + b"MPF\0" + b" " * 70
|
||||
b"\xFF\xE2" + struct.pack(">H", 6 + 82) + b"MPF\0" + b" " * 82
|
||||
)
|
||||
JpegImagePlugin._save(im_frame, fp, filename)
|
||||
offsets.append(fp.tell())
|
||||
|
@ -60,6 +60,7 @@ def _save_all(im, fp, filename):
|
|||
offsets.append(fp.tell() - offsets[-1])
|
||||
|
||||
ifd = TiffImagePlugin.ImageFileDirectory_v2()
|
||||
ifd[0xB000] = b"0100"
|
||||
ifd[0xB001] = len(offsets)
|
||||
|
||||
mpentries = b""
|
||||
|
|
Loading…
Reference in New Issue
Block a user