Do not render text if image has zero width or height

This commit is contained in:
Andrew Murray 2023-03-17 20:11:35 +11:00
parent 2d5f451f58
commit 80edcd18d1

View File

@ -767,6 +767,7 @@ 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)
if min(size):
self.font.render( self.font.render(
text, text,
im.id, im.id,