Skip to content

Commit

Permalink
Removed cast
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jun 22, 2024
1 parent 95066b1 commit 814e193
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1155,10 +1155,7 @@ def convert_transparency(m, v):
if trns is not None:
if new_im.mode == "P":
try:
new_im.info["transparency"] = new_im.palette.getcolor(
cast(Tuple[int, int, int], trns), # trns was converted to RGB
new_im,
)
new_im.info["transparency"] = new_im.palette.getcolor(trns, new_im)
except ValueError as e:
del new_im.info["transparency"]
if str(e) != "cannot allocate more than 256 colors":
Expand Down

0 comments on commit 814e193

Please sign in to comment.