Skip to content

Commit

Permalink
Use has_transparency_data
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Nov 12, 2024
1 parent 56a627a commit 49a8ec6
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/PIL/AvifImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,16 +242,7 @@ def _save(
frame = ims
rawmode = ims.mode
if ims.mode not in _VALID_AVIF_MODES:
alpha = (
"A" in ims.mode
or "a" in ims.mode
or (ims.mode == "P" and "A" in ims.im.getpalettemode())
or (
ims.mode == "P"
and ims.info.get("transparency", None) is not None
)
)
rawmode = "RGBA" if alpha else "RGB"
rawmode = "RGBA" if ims.has_transparency_data else "RGB"
frame = ims.convert(rawmode)

# Update frame duration
Expand Down

0 comments on commit 49a8ec6

Please sign in to comment.