Skip to content

Commit

Permalink
Merge pull request #7483 from radarhere/psd
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Dec 21, 2023
2 parents e2c9e33 + 5056850 commit 7e30619
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Binary file added Tests/images/five_channels.psd
Binary file not shown.
5 changes: 5 additions & 0 deletions Tests/test_file_psd.py
Expand Up @@ -111,6 +111,11 @@ def test_rgba():
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():
with Image.open(test_file) as im:
assert "icc_profile" in im.info
Expand Down
3 changes: 3 additions & 0 deletions src/PIL/PsdImagePlugin.py
Expand Up @@ -186,6 +186,9 @@ def read(size):
ct_types = i16(read(2))
types = list(range(ct_types))
if len(types) > 4:
fp.seek(len(types) * 6 + 12, io.SEEK_CUR)
size = i32(read(4))
fp.seek(size, io.SEEK_CUR)
continue

for _ in types:
Expand Down

0 comments on commit 7e30619

Please sign in to comment.