mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 09:14:27 +03:00
large exif segments
This commit is contained in:
parent
e969b5ae14
commit
a4a856b58a
|
@ -561,6 +561,10 @@ def _save(im, fp, filename):
|
|||
bufsize=0
|
||||
if "optimize" in info:
|
||||
bufsize = im.size[0]*im.size[1]
|
||||
|
||||
# The exif info needs to be written as one block. Ensure that our buffer is big enough
|
||||
if len(info.get("exif",b"")) > max(ImageFile.MAXBLOCK, bufsize):
|
||||
bufsize = 2*len(info.get("exif",b""))
|
||||
|
||||
ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)], bufsize)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user