SusannaMaria / beets-mosaic

Plugin for the music library manager Beets (http://beets.io/).
MIT License
11 stars 0 forks source link

Missing/incorrect font & deprecated function use #1

Open sgpicone opened 1 year ago

sgpicone commented 1 year ago

Hi! Thanks for creating this plugin, it's great!

I had a few issues getting it to run that I thought I'd share -- I was able to fix them by editing the code directly.

The first issue was in line 50 of mosaic.py - basically the URL for the default font is outdated, so the file that gets downloaded isn't a valid font file. Instead, the URL should be https://github.com/googlefonts/Inconsolata/raw/main/fonts/ttf/Inconsolata-Regular.ttf

I had updated line 50 to look like this:

'font': 'https://github.com/googlefonts/'
        'Inconsolata/raw/main/fonts/ttf/'
    'Inconsolata-Regular.ttf'})

The second issue was using Image.ANTIALIAS from PIL on line 238 -- that's been deprecated for a bit and removed in v10+, with the new attribute being LANCZOS

So that means line 238 should read im.thumbnail(size, Image.LANCZOS) instead

After making these changes I was able to generate a great-looking mosaic with the latest beets version and everything!

SusannaMaria commented 8 months ago

I made an update and cleaned up font usage. Tested only on linux so far.