Skip to content

Commit 6519f87

Browse files
committed
Improve the method for saving overlay text on images
1 parent 2de1ad3 commit 6519f87

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6918,13 +6918,14 @@ def save_element_as_image_file(
69186918
image = Image.open(image_file_path)
69196919
draw = ImageDraw.Draw(image)
69206920
draw.rectangle(
6921-
(0, 0, (max_width * 6) + 6, 16 * len_text_rows),
6921+
(0, 0, int(max_width * 8.32) + 10, 23 * len_text_rows + 2),
69226922
fill=(236, 236, 28),
69236923
)
69246924
draw.text(
69256925
(4, 2), # Coordinates
69266926
overlay_text, # Text
6927-
(8, 38, 176), # Color
6927+
fill=(8, 38, 176), # Color
6928+
font_size=18, # Font Size
69286929
)
69296930
image.save(image_file_path, "PNG", quality=100, optimize=True)
69306931

0 commit comments

Comments
 (0)