mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
whitespace error
This commit is contained in:
parent
c41a9b2b23
commit
758da6c581
|
@ -106,50 +106,50 @@ def test_adobe_deflate_tiff():
|
|||
|
||||
|
||||
def test_little_endian():
|
||||
im = Image.open('Tests/images/12bit.deflate.tif')
|
||||
assert_equal(im.getpixel((0,0)), 480)
|
||||
assert_equal(im.mode, 'I;16')
|
||||
im = Image.open('Tests/images/12bit.deflate.tif')
|
||||
assert_equal(im.getpixel((0,0)), 480)
|
||||
assert_equal(im.mode, 'I;16')
|
||||
|
||||
b = im.tobytes()
|
||||
# Bytes are in image native order (little endian)
|
||||
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')
|
||||
b = im.tobytes()
|
||||
# Bytes are in image native order (little endian)
|
||||
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"
|
||||
im.save(out)
|
||||
reread = Image.open(out)
|
||||
out = tempfile("temp.tif")
|
||||
out = "temp.le.tif"
|
||||
im.save(out)
|
||||
reread = Image.open(out)
|
||||
|
||||
assert_equal(reread.info['compression'], im.info['compression'])
|
||||
assert_equal(reread.getpixel((0,0)), 480)
|
||||
# UNDONE - libtiff defaults to writing in native endian, so
|
||||
# on big endian, we'll get back mode = 'I;16B' here.
|
||||
assert_equal(reread.info['compression'], im.info['compression'])
|
||||
assert_equal(reread.getpixel((0,0)), 480)
|
||||
# UNDONE - libtiff defaults to writing in native endian, so
|
||||
# on big endian, we'll get back mode = 'I;16B' here.
|
||||
|
||||
def test_big_endian():
|
||||
im = Image.open('Tests/images/12bit.MM.deflate.tif')
|
||||
im = Image.open('Tests/images/12bit.MM.deflate.tif')
|
||||
|
||||
assert_equal(im.getpixel((0,0)), 480)
|
||||
assert_equal(im.mode, 'I;16B')
|
||||
assert_equal(im.getpixel((0,0)), 480)
|
||||
assert_equal(im.mode, 'I;16B')
|
||||
|
||||
b = im.tobytes()
|
||||
b = im.tobytes()
|
||||
|
||||
# Bytes are in image native order (big endian)
|
||||
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')
|
||||
# Bytes are in image native order (big endian)
|
||||
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)
|
||||
reread = Image.open(out)
|
||||
out = tempfile("temp.tif")
|
||||
im.save(out)
|
||||
reread = Image.open(out)
|
||||
|
||||
assert_equal(reread.info['compression'], im.info['compression'])
|
||||
assert_equal(reread.getpixel((0,0)), 480)
|
||||
assert_equal(reread.info['compression'], im.info['compression'])
|
||||
assert_equal(reread.getpixel((0,0)), 480)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user