Use getim()

This commit is contained in:
Andrew Murray 2024-09-21 16:44:39 +10:00
parent 5d430eab25
commit 9f409e823b

View File

@ -176,15 +176,14 @@ class PhotoImage:
the bitmap image. the bitmap image.
""" """
# convert to blittable # convert to blittable
im.load() ptr = im.getim()
image = im.im image = im.im
if image.isblock() and im.mode == self.__mode: if not image.isblock() or im.mode != self.__mode:
block = image
else:
block = Image.core.new_block(self.__mode, im.size) block = Image.core.new_block(self.__mode, im.size)
image.convert2(block, image) # convert directly between buffers image.convert2(block, image) # convert directly between buffers
ptr = block.ptr
_pyimagingtkcall("PyImagingPhoto", self.__photo, block.ptr) _pyimagingtkcall("PyImagingPhoto", self.__photo, ptr)
# -------------------------------------------------------------------- # --------------------------------------------------------------------