mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 17:24:31 +03:00
remove old version
This commit is contained in:
parent
52c8e2050e
commit
ba92896a53
|
@ -92,23 +92,12 @@ class PillowTestCase(unittest.TestCase):
|
|||
a.size, b.size,
|
||||
msg or "got size %r, expected %r" % (a.size, b.size))
|
||||
|
||||
diff = 0
|
||||
try:
|
||||
ord(b'0')
|
||||
for abyte, bbyte in zip(a.tobytes(), b.tobytes()):
|
||||
diff += abs(ord(abyte)-ord(bbyte))
|
||||
except:
|
||||
for abyte, bbyte in zip(a.tobytes(), b.tobytes()):
|
||||
diff += abs(abyte-bbyte)
|
||||
|
||||
a, b = convert_to_comparable(a, b)
|
||||
|
||||
new_diff = 0
|
||||
diff = 0
|
||||
for ach, bch in zip(a.split(), b.split()):
|
||||
chdiff = ImageMath.eval("abs(a - b)", a=ach, b=bch).convert('L')
|
||||
new_diff += sum(i * num for i, num in enumerate(chdiff.histogram()))
|
||||
|
||||
self.assertEqual(diff, new_diff)
|
||||
diff += sum(i * num for i, num in enumerate(chdiff.histogram()))
|
||||
|
||||
ave_diff = float(diff)/(a.size[0]*a.size[1])
|
||||
self.assertGreaterEqual(
|
||||
|
|
|
@ -205,7 +205,7 @@ class TestImageCms(PillowTestCase):
|
|||
|
||||
target = Image.open('Tests/images/hopper.Lab.tif')
|
||||
|
||||
self.assert_image_similar(i, target, 30)
|
||||
self.assert_image_similar(i, target, 3.5)
|
||||
|
||||
def test_lab_srgb(self):
|
||||
psRGB = ImageCms.createProfile("sRGB")
|
||||
|
@ -326,12 +326,12 @@ class TestImageCms(PillowTestCase):
|
|||
|
||||
prepatch, these would segfault, postpatch they should emit a typeerror
|
||||
"""
|
||||
|
||||
|
||||
with self.assertRaises(TypeError):
|
||||
ImageCms.ImageCmsProfile(0).tobytes()
|
||||
with self.assertRaises(TypeError):
|
||||
ImageCms.ImageCmsProfile(1).tobytes()
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Reference in New Issue
Block a user