This commit is contained in:
Eric Soroos 2013-10-21 22:53:35 +00:00
parent 3128a76495
commit 8d21ce1df7
2 changed files with 26 additions and 11 deletions

View File

@ -112,8 +112,13 @@ def test_little_endian():
b = im.tobytes()
# Bytes are in image native order (little endian)
assert_equal(b[0], b'\xe0')
assert_equal(b[1], b'\x01')
if py3:
assert_equal(b[0], ord(b'\xe0'))
assert_equal(b[1], ord(b'\x01'))
else:
assert_equal(b[0], b'\xe0')
assert_equal(b[1], b'\x01')
out = tempfile("temp.tif")
out = "temp.le.tif"
@ -134,8 +139,12 @@ def test_big_endian():
b = im.tobytes()
# Bytes are in image native order (big endian)
assert_equal(b[0], b'\x01')
assert_equal(b[1], b'\xe0')
if py3:
assert_equal(b[0], ord(b'\x01'))
assert_equal(b[1], ord(b'\xe0'))
else:
assert_equal(b[0], b'\x01')
assert_equal(b[1], b'\xe0')
out = tempfile("temp.tif")
im.save(out)

View File

@ -80,8 +80,13 @@ def test_little_endian():
b = im.tobytes()
# Bytes are in image native order (little endian)
assert_equal(b[0], b'\xe0')
assert_equal(b[1], b'\x01')
if py3:
assert_equal(b[0], ord(b'\xe0'))
assert_equal(b[1], ord(b'\x01'))
else:
assert_equal(b[0], b'\xe0')
assert_equal(b[1], b'\x01')
def test_big_endian():
im = Image.open('Tests/images/12bit.MM.cropped.tif')
@ -91,8 +96,9 @@ def test_big_endian():
b = im.tobytes()
# Bytes are in image native order (big endian)
assert_equal(b[0], b'\x01')
assert_equal(b[1], b'\xe0')
if py3:
assert_equal(b[0], ord(b'\x01'))
assert_equal(b[1], ord(b'\xe0'))
else:
assert_equal(b[0], b'\x01')
assert_equal(b[1], b'\xe0')