mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
ad784eb808
This is Christoph Gohlke's test suite from his personal PIL package found at http://www.lfd.uci.edu/~gohlke/pythonlibs/. This is just to bring it in as a separate commit. Future commits will align it with Pillow.
44 lines
859 B
Python
44 lines
859 B
Python
from tester import *
|
|
|
|
from PIL import Image
|
|
|
|
def test_sanity():
|
|
|
|
im1 = lena()
|
|
im2 = Image.new(im1.mode, im1.size, 0)
|
|
|
|
for y in range(im1.size[1]):
|
|
for x in range(im1.size[0]):
|
|
pos = x, y
|
|
im2.putpixel(pos, im1.getpixel(pos))
|
|
|
|
assert_image_equal(im1, im2)
|
|
|
|
im2 = Image.new(im1.mode, im1.size, 0)
|
|
im2.readonly = 1
|
|
|
|
for y in range(im1.size[1]):
|
|
for x in range(im1.size[0]):
|
|
pos = x, y
|
|
im2.putpixel(pos, im1.getpixel(pos))
|
|
|
|
assert_false(im2.readonly)
|
|
assert_image_equal(im1, im2)
|
|
|
|
im2 = Image.new(im1.mode, im1.size, 0)
|
|
|
|
pix1 = im1.load()
|
|
pix2 = im2.load()
|
|
|
|
for y in range(im1.size[1]):
|
|
for x in range(im1.size[0]):
|
|
pix2[x, y] = pix1[x, y]
|
|
|
|
assert_image_equal(im1, im2)
|
|
|
|
|
|
|
|
|
|
# see test_image_getpixel for more tests
|
|
|