Politrees commited on
Commit
91cb011
·
verified ·
1 Parent(s): 5924dfb

Update steganography.py

Browse files
Files changed (1) hide show
  1. steganography.py +1 -2
steganography.py CHANGED
@@ -24,8 +24,7 @@ def text_to_spectrogram_image(text, base_width=512, height=256, max_font_size=80
24
  logging.warning(f"Font not found at {DEFAULT_FONT_PATH}. Using default font.")
25
  font = ImageFont.load_default()
26
 
27
- image = Image.new('L', (base_width, height), 'black')
28
- draw = ImageDraw.Draw(image)
29
 
30
  text_width = sum(draw.textbbox((0, 0), char, font=font)[2] - draw.textbbox((0, 0), char, font=font)[0] + letter_spacing for char in text) - letter_spacing
31
  text_height = draw.textbbox((0, 0), text[0], font=font)[3] - draw.textbbox((0, 0), text[0], font=font)[1]
 
24
  logging.warning(f"Font not found at {DEFAULT_FONT_PATH}. Using default font.")
25
  font = ImageFont.load_default()
26
 
27
+ draw = ImageDraw.Draw(Image.new('L', (1, 1)))
 
28
 
29
  text_width = sum(draw.textbbox((0, 0), char, font=font)[2] - draw.textbbox((0, 0), char, font=font)[0] + letter_spacing for char in text) - letter_spacing
30
  text_height = draw.textbbox((0, 0), text[0], font=font)[3] - draw.textbbox((0, 0), text[0], font=font)[1]