mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-05-30 18:53:28 +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():
|
def test_little_endian():
|
||||||
im = Image.open('Tests/images/12bit.deflate.tif')
|
im = Image.open('Tests/images/12bit.deflate.tif')
|
||||||
assert_equal(im.getpixel((0,0)), 480)
|
assert_equal(im.getpixel((0,0)), 480)
|
||||||
assert_equal(im.mode, 'I;16')
|
assert_equal(im.mode, 'I;16')
|
||||||
|
|
||||||
b = im.tobytes()
|
b = im.tobytes()
|
||||||
# Bytes are in image native order (little endian)
|
# Bytes are in image native order (little endian)
|
||||||
if py3:
|
if py3:
|
||||||
assert_equal(b[0], ord(b'\xe0'))
|
assert_equal(b[0], ord(b'\xe0'))
|
||||||
assert_equal(b[1], ord(b'\x01'))
|
assert_equal(b[1], ord(b'\x01'))
|
||||||
else:
|
else:
|
||||||
assert_equal(b[0], b'\xe0')
|
assert_equal(b[0], b'\xe0')
|
||||||
assert_equal(b[1], b'\x01')
|
assert_equal(b[1], b'\x01')
|
||||||
|
|
||||||
|
|
||||||
out = tempfile("temp.tif")
|
out = tempfile("temp.tif")
|
||||||
out = "temp.le.tif"
|
out = "temp.le.tif"
|
||||||
im.save(out)
|
im.save(out)
|
||||||
reread = Image.open(out)
|
reread = Image.open(out)
|
||||||
|
|
||||||
assert_equal(reread.info['compression'], im.info['compression'])
|
assert_equal(reread.info['compression'], im.info['compression'])
|
||||||
assert_equal(reread.getpixel((0,0)), 480)
|
assert_equal(reread.getpixel((0,0)), 480)
|
||||||
# UNDONE - libtiff defaults to writing in native endian, so
|
# UNDONE - libtiff defaults to writing in native endian, so
|
||||||
# on big endian, we'll get back mode = 'I;16B' here.
|
# on big endian, we'll get back mode = 'I;16B' here.
|
||||||
|
|
||||||
def test_big_endian():
|
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.getpixel((0,0)), 480)
|
||||||
assert_equal(im.mode, 'I;16B')
|
assert_equal(im.mode, 'I;16B')
|
||||||
|
|
||||||
b = im.tobytes()
|
b = im.tobytes()
|
||||||
|
|
||||||
# Bytes are in image native order (big endian)
|
# Bytes are in image native order (big endian)
|
||||||
if py3:
|
if py3:
|
||||||
assert_equal(b[0], ord(b'\x01'))
|
assert_equal(b[0], ord(b'\x01'))
|
||||||
assert_equal(b[1], ord(b'\xe0'))
|
assert_equal(b[1], ord(b'\xe0'))
|
||||||
else:
|
else:
|
||||||
assert_equal(b[0], b'\x01')
|
assert_equal(b[0], b'\x01')
|
||||||
assert_equal(b[1], b'\xe0')
|
assert_equal(b[1], b'\xe0')
|
||||||
|
|
||||||
out = tempfile("temp.tif")
|
out = tempfile("temp.tif")
|
||||||
im.save(out)
|
im.save(out)
|
||||||
reread = Image.open(out)
|
reread = Image.open(out)
|
||||||
|
|
||||||
assert_equal(reread.info['compression'], im.info['compression'])
|
assert_equal(reread.info['compression'], im.info['compression'])
|
||||||
assert_equal(reread.getpixel((0,0)), 480)
|
assert_equal(reread.getpixel((0,0)), 480)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user