mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Try to fix test_file_jpeg in Python3
This commit is contained in:
parent
a0af87e524
commit
97b23af7e5
|
@ -1,6 +1,5 @@
|
||||||
from tester import *
|
from tester import *
|
||||||
|
|
||||||
import array
|
|
||||||
import random
|
import random
|
||||||
|
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
@ -137,8 +136,7 @@ def test_progressive_large_buffer():
|
||||||
|
|
||||||
def test_progressive_large_buffer_highest_quality():
|
def test_progressive_large_buffer_highest_quality():
|
||||||
f = tempfile('temp.jpg')
|
f = tempfile('temp.jpg')
|
||||||
a = array.array('B')
|
a = b''.join(chr(random.randint(0, 255)) for _ in range(256 * 256 * 3))
|
||||||
a.extend(random.randint(0, 255) for _ in range(256 * 256 * 3))
|
|
||||||
im = Image.frombuffer("RGB", (256, 256), a, "raw", "RGB", 0, 1)
|
im = Image.frombuffer("RGB", (256, 256), a, "raw", "RGB", 0, 1)
|
||||||
# this requires more bytes than pixels in the image
|
# this requires more bytes than pixels in the image
|
||||||
im.save(f, format="JPEG", progressive=True, quality=100)
|
im.save(f, format="JPEG", progressive=True, quality=100)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user