TheRenegadeCoder / image-titler

An image title generator using The Renegade Coder style
https://therenegadecoder.com
GNU General Public License v3.0
17 stars 6 forks source link

Some Logos Fail to Render #53

Open jrg94 opened 4 years ago

jrg94 commented 4 years ago

I attempted to add an old log of my to the image, and I ran into an error:

Logo Overlay Error

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\Jeremy Grifski\AppData\Local\Programs\Python\Python38-32\lib\tkinter\__init__.py", line 1883, in __call__
    return self.func(*args)
  File "E:/Projects/trc-image-titler/image_titler/gui.py", line 83, in update_view
    self._render_preview(title=title, tier=tier, logo_path=logo_path)
  File "E:/Projects/trc-image-titler/image_titler/gui.py", line 96, in _render_preview
    self.menu.current_edit = process_image(self.menu.image_path, title, tier=tier, logo_path=logo_path)
  File "E:\Projects\trc-image-titler\image_titler\utilities.py", line 258, in process_image
    _draw_logo(cropped_img, logo)
  File "E:\Projects\trc-image-titler\image_titler\utilities.py", line 127, in _draw_logo
    img.paste(logo, (LOGO_PADDING, height - LOGO_SIZE[1] - LOGO_PADDING), logo)
  File "E:\Projects\trc-image-titler\venv\lib\site-packages\PIL\Image.py", line 1494, in paste
    self.im.paste(im, box, mask.im)
ValueError: bad transparency mask

I haven't had time to investigate this, so I figured I'd drop the issue here for now. I'm wondering if it's because this logo is a jpg. Maybe we should restrict logos to pngs.

jrg94 commented 4 years ago

Nevermind, I got this same issue for a different logo:

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\Jeremy Grifski\AppData\Local\Programs\Python\Python38-32\lib\tkinter\__init__.py", line 1883, in __call__
    return self.func(*args)
  File "E:/Projects/trc-image-titler/image_titler/gui.py", line 83, in update_view
    self._render_preview(title=title, tier=tier, logo_path=logo_path)
  File "E:/Projects/trc-image-titler/image_titler/gui.py", line 96, in _render_preview
    self.menu.current_edit = process_image(self.menu.image_path, title, tier=tier, logo_path=logo_path)
  File "E:\Projects\trc-image-titler\image_titler\utilities.py", line 258, in process_image
    _draw_logo(cropped_img, logo)
  File "E:\Projects\trc-image-titler\image_titler\utilities.py", line 127, in _draw_logo
    img.paste(logo, (LOGO_PADDING, height - LOGO_SIZE[1] - LOGO_PADDING), logo)
  File "E:\Projects\trc-image-titler\venv\lib\site-packages\PIL\Image.py", line 1494, in paste
    self.im.paste(im, box, mask.im)
ValueError: bad transparency mask
jrg94 commented 4 years ago

Here are the culprits:

icon-360x360

icon-cut-down-square