Skip to content

Commit

Permalink
Use getim()
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Sep 21, 2024
1 parent 5d430ea commit 9f409e8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/PIL/ImageTk.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,14 @@ def paste(self, im: Image.Image) -> None:
the bitmap image.
"""
# convert to blittable
im.load()
ptr = im.getim()
image = im.im
if image.isblock() and im.mode == self.__mode:
block = image
else:
if not image.isblock() or im.mode != self.__mode:
block = Image.core.new_block(self.__mode, im.size)
image.convert2(block, image) # convert directly between buffers
ptr = block.ptr

_pyimagingtkcall("PyImagingPhoto", self.__photo, block.ptr)
_pyimagingtkcall("PyImagingPhoto", self.__photo, ptr)


# --------------------------------------------------------------------
Expand Down

0 comments on commit 9f409e8

Please sign in to comment.