Skip to content

Commit

Permalink
Use Image.getim() instead of ImagingCore.ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
homm committed Sep 16, 2024
1 parent 4d271c8 commit d1f40a9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/PIL/WebPImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ def _save_all(im: Image.Image, fp: IO[bytes], filename: str | bytes) -> None:

for idx in range(nfr):
ims.seek(idx)
ims.load()

# Make sure image mode is supported
frame = ims
Expand All @@ -248,7 +247,7 @@ def _save_all(im: Image.Image, fp: IO[bytes], filename: str | bytes) -> None:

# Append the frame to the animation encoder
enc.add(
frame.im.ptr,
frame.getim(),
round(timestamp),
lossless,
quality,
Expand Down Expand Up @@ -296,7 +295,7 @@ def _save(im: Image.Image, fp: IO[bytes], filename: str | bytes) -> None:
im = im.convert("RGBA" if im.has_transparency_data else "RGB")

data = _webp.WebPEncode(
im.im.ptr,
im.getim(),
lossless,
float(quality),
float(alpha_quality),
Expand Down

0 comments on commit d1f40a9

Please sign in to comment.