Skip to content

Commit

Permalink
quality improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
parishwolfe committed Sep 25, 2024
1 parent e97158e commit 842505d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
1 change: 0 additions & 1 deletion product_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import random
from datetime import datetime

from util.shopify_util import shopify_util
from util.printify_util import printify_util
from util.ai_util import ai_util
from util.image_util import create_text_image
Expand Down
36 changes: 19 additions & 17 deletions util/image_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,22 @@ def does_text_fit(draw, text, font, width, height):
fits = (total_height <= height) and not any_line_too_wide
return fits, wrapped_text, total_height

# Example usage:
create_text_image(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
800,
1200,
"img/test_1.png",
"#000000"
)
create_text_image(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
800,
400,
"img/test_2.png",
"#FF5733"
)
create_text_image("Lorem ipsum dolor sit amet", 800, 1200, "img/test_3.png")
create_text_image("Lorem ipsum dolor sit amet", 800, 400, "img/test_4.png", "#FFFFFF")

if __name__ == "__main__":
# Example usage:
create_text_image(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
800,
1200,
"img/test_1.png",
"#000000"
)
create_text_image(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
800,
400,
"img/test_2.png",
"#FF5733"
)
create_text_image("Lorem ipsum dolor sit amet", 800, 1200, "img/test_3.png")
create_text_image("Lorem ipsum dolor sit amet", 800, 400, "img/test_4.png", "#FFFFFF")

0 comments on commit 842505d

Please sign in to comment.