aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Pillow/py3/PIL/ImageDraw.py
diff options
context:
space:
mode:
authorAlexSm <alex@ydb.tech>2024-01-26 16:00:50 +0100
committerGitHub <noreply@github.com>2024-01-26 16:00:50 +0100
commit7ebcfd058d924bcc8c23da70e034f7415687885c (patch)
treee4f00d163c77528c1855f2d7af54a8be83fc1ccb /contrib/python/Pillow/py3/PIL/ImageDraw.py
parent64ca2dcd06312b9eef624054ceb5f787e11be79a (diff)
parent6d79e7793c2c462134f4b4a7d911abc7b9b0766f (diff)
downloadydb-7ebcfd058d924bcc8c23da70e034f7415687885c.tar.gz
Merge pull request #1260 from ydb-platform/mergelibs10
mergelibs10
Diffstat (limited to 'contrib/python/Pillow/py3/PIL/ImageDraw.py')
-rw-r--r--contrib/python/Pillow/py3/PIL/ImageDraw.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/python/Pillow/py3/PIL/ImageDraw.py b/contrib/python/Pillow/py3/PIL/ImageDraw.py
index fbf320d72a..84665f54ff 100644
--- a/contrib/python/Pillow/py3/PIL/ImageDraw.py
+++ b/contrib/python/Pillow/py3/PIL/ImageDraw.py
@@ -29,9 +29,11 @@
#
# See the README file for information on usage and redistribution.
#
+from __future__ import annotations
import math
import numbers
+import struct
from . import Image, ImageColor
@@ -542,7 +544,8 @@ class ImageDraw:
# font.getmask2(mode="RGBA") returns color in RGB bands and mask in A
# extract mask and set text alpha
color, mask = mask, mask.getband(3)
- color.fillband(3, (ink >> 24) & 0xFF)
+ ink_alpha = struct.pack("i", ink)[3]
+ color.fillband(3, ink_alpha)
x, y = coord
self.im.paste(color, (x, y, x + mask.size[0], y + mask.size[1]), mask)
else:
@@ -921,7 +924,7 @@ def floodfill(image, xy, value, border=None, thresh=0):
if border is None:
fill = _color_diff(p, background) <= thresh
else:
- fill = p != value and p != border
+ fill = p not in (value, border)
if fill:
pixel[s, t] = value
new_edge.add((s, t))