mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Deprecated PhotoImage.paste() box parameter
This commit is contained in:
parent
a575ec33d2
commit
a724be66be
|
@ -80,6 +80,13 @@ def test_photoimage_blank():
|
|||
assert_image_equal(reloaded.convert(mode), im)
|
||||
|
||||
|
||||
def test_box_deprecation():
|
||||
im = hopper()
|
||||
im_tk = ImageTk.PhotoImage(im)
|
||||
with pytest.warns(DeprecationWarning):
|
||||
im_tk.paste(im, (0, 0, 128, 128))
|
||||
|
||||
|
||||
def test_bitmapimage():
|
||||
im = hopper("1")
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#
|
||||
|
||||
import tkinter
|
||||
import warnings
|
||||
from io import BytesIO
|
||||
|
||||
from . import Image
|
||||
|
@ -183,11 +184,15 @@ class PhotoImage:
|
|||
:param im: A PIL image. The size must match the target region. If the
|
||||
mode does not match, the image is converted to the mode of
|
||||
the bitmap image.
|
||||
:param box: A 4-tuple defining the left, upper, right, and lower pixel
|
||||
coordinate. See :ref:`coordinate-system`. If None is given
|
||||
instead of a tuple, all of the image is assumed.
|
||||
"""
|
||||
|
||||
if box is not None:
|
||||
warnings.warn(
|
||||
"The box parameter is deprecated and will be removed in Pillow 10 "
|
||||
"(2023-07-01).",
|
||||
DeprecationWarning,
|
||||
)
|
||||
|
||||
# convert to blittable
|
||||
im.load()
|
||||
image = im.im
|
||||
|
|
Loading…
Reference in New Issue
Block a user