reddit_video_maker icon indicating copy to clipboard operation
reddit_video_maker copied to clipboard

Long text goes outside the image

Open GearKite opened this issue 3 years ago • 2 comments

Longer comments go outside the image like this reply12 reply43

GearKite avatar Jun 16 '21 18:06 GearKite

Thanks for the issue! This logic is currently in src/utils.py around line 40. in this block of code:

for line in utils.split_string(text, 10):        
     text_dimensions = utils.get_text_dimensions(line, font)   
     x = (image_width - text_dimensions[0]) / 2                      
     draw.text((x, y),line,font=font,fill=(255,255,255))            
     y += 50 # adding 50 pixel buffer to next line

This is an edge case that haddent come up on the demo's I tested this for. I am open to different suggestions on how to alter the code to fix that problem such as multiple images (like a continued page or something). Since it seems like more people are interested in this code after posting it to reddit I am open to hearing the communities ideas for a fix before implementing a change in the code. Feel free to give a suggestion.

alexshelto avatar Jun 17 '21 04:06 alexshelto

The logic is now in ImageCreator.py still unchanged.

alexshelto avatar Jun 28 '21 18:06 alexshelto