mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
197885164b
Most of the differences are in tobytes/tostring naming and expected behavior of the bytes() constructor. The latter was usually easy to fix with the right bytes literal. This is a good preview of what will have to happen in the Python 3 code.
17 lines
287 B
Python
17 lines
287 B
Python
from tester import *
|
|
|
|
from PIL import Image
|
|
|
|
def test_sanity():
|
|
|
|
im1 = lena()
|
|
im2 = None
|
|
|
|
if py3:
|
|
im2 = Image.frombytes(im1.mode, im1.size, im1.tobytes())
|
|
else:
|
|
im2 = Image.fromstring(im1.mode, im1.size, im1.tostring())
|
|
|
|
assert_image_equal(im1, im2)
|
|
|