mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-09 16:10:48 +03:00
Seek past the data when skipping a layer
This commit is contained in:
parent
a10dec01b5
commit
5056850a2f
BIN
Tests/images/five_channels.psd
Normal file
BIN
Tests/images/five_channels.psd
Normal file
Binary file not shown.
|
@ -111,6 +111,11 @@ def test_rgba():
|
||||||
assert_image_equal_tofile(im, "Tests/images/imagedraw_square.png")
|
assert_image_equal_tofile(im, "Tests/images/imagedraw_square.png")
|
||||||
|
|
||||||
|
|
||||||
|
def test_layer_skip():
|
||||||
|
with Image.open("Tests/images/five_channels.psd") as im:
|
||||||
|
assert im.n_frames == 1
|
||||||
|
|
||||||
|
|
||||||
def test_icc_profile():
|
def test_icc_profile():
|
||||||
with Image.open(test_file) as im:
|
with Image.open(test_file) as im:
|
||||||
assert "icc_profile" in im.info
|
assert "icc_profile" in im.info
|
||||||
|
|
|
@ -186,6 +186,9 @@ def _layerinfo(fp, ct_bytes):
|
||||||
ct_types = i16(read(2))
|
ct_types = i16(read(2))
|
||||||
types = list(range(ct_types))
|
types = list(range(ct_types))
|
||||||
if len(types) > 4:
|
if len(types) > 4:
|
||||||
|
fp.seek(len(types) * 6 + 12, io.SEEK_CUR)
|
||||||
|
size = i32(read(4))
|
||||||
|
fp.seek(size, io.SEEK_CUR)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for _ in types:
|
for _ in types:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user