mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
Do not render text if image has zero width or height
This commit is contained in:
parent
2d5f451f58
commit
80edcd18d1
|
@ -767,18 +767,19 @@ class FreeTypeFont:
|
||||||
offset = offset[0] - stroke_width, offset[1] - stroke_width
|
offset = offset[0] - stroke_width, offset[1] - stroke_width
|
||||||
Image._decompression_bomb_check(size)
|
Image._decompression_bomb_check(size)
|
||||||
im = fill("RGBA" if mode == "RGBA" else "L", size, 0)
|
im = fill("RGBA" if mode == "RGBA" else "L", size, 0)
|
||||||
self.font.render(
|
if min(size):
|
||||||
text,
|
self.font.render(
|
||||||
im.id,
|
text,
|
||||||
mode,
|
im.id,
|
||||||
direction,
|
mode,
|
||||||
features,
|
direction,
|
||||||
language,
|
features,
|
||||||
stroke_width,
|
language,
|
||||||
ink,
|
stroke_width,
|
||||||
start[0],
|
ink,
|
||||||
start[1],
|
start[0],
|
||||||
)
|
start[1],
|
||||||
|
)
|
||||||
return im, offset
|
return im, offset
|
||||||
|
|
||||||
def font_variant(
|
def font_variant(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user