Skip to content

Commit

Permalink
Simplified code
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jan 9, 2024
1 parent d7874e8 commit df99d48
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/PIL/PsdImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,13 @@ def read(size):
# image info
mode = []
ct_types = i16(read(2))
types = list(range(ct_types))
if len(types) > 4:
fp.seek(len(types) * 6 + 12, io.SEEK_CUR)
if ct_types > 4:
fp.seek(ct_types * 6 + 12, io.SEEK_CUR)
size = i32(read(4))
fp.seek(size, io.SEEK_CUR)
continue

for _ in types:
for _ in range(ct_types):
type = i16(read(2))

if type == 65535:
Expand Down

0 comments on commit df99d48

Please sign in to comment.