mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
upload: Replace deprecated PIL.PngImagePlugin.APNG_DISPOSE_OP_NONE.
https://pillow.readthedocs.io/en/stable/deprecations.html#constants
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit f90a41bab0)
This commit is contained in:
committed by
Tim Abbott
parent
961be78940
commit
fe27f8eb40
@@ -172,7 +172,12 @@ def resize_animated(im: Image.Image, size: int = DEFAULT_EMOJI_SIZE) -> bytes:
|
|||||||
im.disposal_method # type: ignore[attr-defined] # private member missing from stubs
|
im.disposal_method # type: ignore[attr-defined] # private member missing from stubs
|
||||||
)
|
)
|
||||||
elif isinstance(im, PngImagePlugin.PngImageFile):
|
elif isinstance(im, PngImagePlugin.PngImageFile):
|
||||||
disposals.append(im.info.get("disposal", PngImagePlugin.APNG_DISPOSE_OP_NONE))
|
disposals.append(
|
||||||
|
im.info.get(
|
||||||
|
"disposal",
|
||||||
|
PngImagePlugin.Disposal.OP_NONE, # type: ignore[attr-defined] # https://github.com/python/typeshed/pull/9698
|
||||||
|
)
|
||||||
|
)
|
||||||
else: # nocoverage
|
else: # nocoverage
|
||||||
raise BadImageError(_("Unknown animated image format."))
|
raise BadImageError(_("Unknown animated image format."))
|
||||||
out = io.BytesIO()
|
out = io.BytesIO()
|
||||||
|
|||||||
Reference in New Issue
Block a user