Skip to content

Commit 7e30619

Browse files
authored
Merge pull request #7483 from radarhere/psd
2 parents e2c9e33 + 5056850 commit 7e30619

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

Tests/images/five_channels.psd

1.09 KB
Binary file not shown.

Tests/test_file_psd.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ def test_rgba():
111111
assert_image_equal_tofile(im, "Tests/images/imagedraw_square.png")
112112

113113

114+
def test_layer_skip():
115+
with Image.open("Tests/images/five_channels.psd") as im:
116+
assert im.n_frames == 1
117+
118+
114119
def test_icc_profile():
115120
with Image.open(test_file) as im:
116121
assert "icc_profile" in im.info

src/PIL/PsdImagePlugin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ def read(size):
186186
ct_types = i16(read(2))
187187
types = list(range(ct_types))
188188
if len(types) > 4:
189+
fp.seek(len(types) * 6 + 12, io.SEEK_CUR)
190+
size = i32(read(4))
191+
fp.seek(size, io.SEEK_CUR)
189192
continue
190193

191194
for _ in types:

0 commit comments

Comments
 (0)