(text, image, font)
| 11 | draw = ImageDraw.Draw(image) |
| 12 | |
| 13 | def get_text_size(text, image, font): |
| 14 | im = Image.new('RGB', (image.width, image.height)) |
| 15 | draw = ImageDraw.Draw(im) |
| 16 | _, _, width, height = draw.textbbox((0, 0), text=text, font=font) |
| 17 | return width, height |
| 18 | |
| 19 | def expand_bbox(bbox): |
| 20 | x1, y1, x2, y2 = bbox |
no outgoing calls
no test coverage detected