mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Another attempt to achieve python 3 compatibility.
This commit is contained in:
parent
97b23af7e5
commit
96ca9ff6ff
|
@ -136,7 +136,10 @@ def test_progressive_large_buffer():
|
|||
|
||||
def test_progressive_large_buffer_highest_quality():
|
||||
f = tempfile('temp.jpg')
|
||||
a = b''.join(chr(random.randint(0, 255)) for _ in range(256 * 256 * 3))
|
||||
if py3:
|
||||
a = bytes(random.randint(0, 255) for _ in range(256 * 256 * 3))
|
||||
else:
|
||||
a = b''.join(chr(random.randint(0, 255)) for _ in range(256 * 256 * 3))
|
||||
im = Image.frombuffer("RGB", (256, 256), a, "raw", "RGB", 0, 1)
|
||||
# this requires more bytes than pixels in the image
|
||||
im.save(f, format="JPEG", progressive=True, quality=100)
|
||||
|
|
Loading…
Reference in New Issue
Block a user