mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-03-24 20:14:13 +03:00
Merge c68044bf7f
into dcb6eef590
This commit is contained in:
commit
8759a39f3a
|
@ -561,7 +561,7 @@ def _save(im, fp, filename):
|
||||||
# is a value that's been used in a django patch.
|
# is a value that's been used in a django patch.
|
||||||
# https://github.com/jdriscoll/django-imagekit/issues/50
|
# https://github.com/jdriscoll/django-imagekit/issues/50
|
||||||
bufsize=0
|
bufsize=0
|
||||||
if "optimize" in info:
|
if "optimize" in info or "progressive" in info or "progression" in info:
|
||||||
bufsize = im.size[0]*im.size[1]
|
bufsize = im.size[0]*im.size[1]
|
||||||
|
|
||||||
# The exif info needs to be written as one block, + APP1, + one spare byte.
|
# The exif info needs to be written as one block, + APP1, + one spare byte.
|
||||||
|
|
|
@ -120,6 +120,18 @@ def test_optimize_large_buffer():
|
||||||
im = Image.new("RGB", (4096,4096), 0xff3333)
|
im = Image.new("RGB", (4096,4096), 0xff3333)
|
||||||
im.save(f, format="JPEG", optimize=True)
|
im.save(f, format="JPEG", optimize=True)
|
||||||
|
|
||||||
|
def test_progressive():
|
||||||
|
im1 = roundtrip(lena())
|
||||||
|
im2 = roundtrip(lena(), progressive=True)
|
||||||
|
assert_image_equal(im1, im2)
|
||||||
|
assert_true(im1.bytes >= im2.bytes)
|
||||||
|
|
||||||
|
def test_progressive_large_buffer():
|
||||||
|
f = tempfile('temp.jpg')
|
||||||
|
# this requires ~ 1.5x Image.MAXBLOCK
|
||||||
|
im = Image.new("RGB", (4096,4096), 0xff3333)
|
||||||
|
im.save(f, format="JPEG", progressive=True)
|
||||||
|
|
||||||
def test_large_exif():
|
def test_large_exif():
|
||||||
#https://github.com/python-imaging/Pillow/issues/148
|
#https://github.com/python-imaging/Pillow/issues/148
|
||||||
f = tempfile('temp.jpg')
|
f = tempfile('temp.jpg')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user