Skip to content

Commit

Permalink
chore: Manutenção na função save_image
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan-bs committed Jan 29, 2025
1 parent 7f8a7ec commit 4f84c71
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Bots/bot_Twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,12 @@ def save_image(data, output_dir):
os.makedirs(output_dir)

width, height = 800, 1200
font_path = "C:/Windows/Fonts/arial.ttf"
font = ImageFont.truetype(font_path, size=10)

try:
font = ImageFont.load_default()
except Exception as e:
print(f"Erro ao carregar a fonte: {e}. Usando fonte padrão.")
font = ImageFont.load_default()

images_created = 0
items_per_image = len(data) // 4 + (1 if len(data) % 4 != 0 else 0)
Expand Down

0 comments on commit 4f84c71

Please sign in to comment.