mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
Merge pull request #6735 from radarhere/mpformatversion
This commit is contained in:
commit
759b0301b9
|
@ -268,6 +268,7 @@ def test_save_all():
|
||||||
im_reloaded = roundtrip(im, save_all=True, append_images=[im2])
|
im_reloaded = roundtrip(im, save_all=True, append_images=[im2])
|
||||||
|
|
||||||
assert_image_equal(im, im_reloaded)
|
assert_image_equal(im, im_reloaded)
|
||||||
|
assert im_reloaded.mpinfo[45056] == b"0100"
|
||||||
|
|
||||||
im_reloaded.seek(1)
|
im_reloaded.seek(1)
|
||||||
assert_image_similar(im2, im_reloaded, 1)
|
assert_image_similar(im2, im_reloaded, 1)
|
||||||
|
|
|
@ -51,7 +51,7 @@ def _save_all(im, fp, filename):
|
||||||
if not offsets:
|
if not offsets:
|
||||||
# APP2 marker
|
# APP2 marker
|
||||||
im.encoderinfo["extra"] = (
|
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)
|
JpegImagePlugin._save(im_frame, fp, filename)
|
||||||
offsets.append(fp.tell())
|
offsets.append(fp.tell())
|
||||||
|
@ -60,6 +60,7 @@ def _save_all(im, fp, filename):
|
||||||
offsets.append(fp.tell() - offsets[-1])
|
offsets.append(fp.tell() - offsets[-1])
|
||||||
|
|
||||||
ifd = TiffImagePlugin.ImageFileDirectory_v2()
|
ifd = TiffImagePlugin.ImageFileDirectory_v2()
|
||||||
|
ifd[0xB000] = b"0100"
|
||||||
ifd[0xB001] = len(offsets)
|
ifd[0xB001] = len(offsets)
|
||||||
|
|
||||||
mpentries = b""
|
mpentries = b""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user