mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Use Image.getim() instead of ImagingCore.ptr
This commit is contained in:
parent
4d271c8ec8
commit
d1f40a94ff
|
@ -239,7 +239,6 @@ def _save_all(im: Image.Image, fp: IO[bytes], filename: str | bytes) -> None:
|
||||||
|
|
||||||
for idx in range(nfr):
|
for idx in range(nfr):
|
||||||
ims.seek(idx)
|
ims.seek(idx)
|
||||||
ims.load()
|
|
||||||
|
|
||||||
# Make sure image mode is supported
|
# Make sure image mode is supported
|
||||||
frame = ims
|
frame = ims
|
||||||
|
@ -248,7 +247,7 @@ def _save_all(im: Image.Image, fp: IO[bytes], filename: str | bytes) -> None:
|
||||||
|
|
||||||
# Append the frame to the animation encoder
|
# Append the frame to the animation encoder
|
||||||
enc.add(
|
enc.add(
|
||||||
frame.im.ptr,
|
frame.getim(),
|
||||||
round(timestamp),
|
round(timestamp),
|
||||||
lossless,
|
lossless,
|
||||||
quality,
|
quality,
|
||||||
|
@ -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")
|
im = im.convert("RGBA" if im.has_transparency_data else "RGB")
|
||||||
|
|
||||||
data = _webp.WebPEncode(
|
data = _webp.WebPEncode(
|
||||||
im.im.ptr,
|
im.getim(),
|
||||||
lossless,
|
lossless,
|
||||||
float(quality),
|
float(quality),
|
||||||
float(alpha_quality),
|
float(alpha_quality),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user