rm-hull / luma.examples

Companion repo for running examples against the luma.oled, luma.lcd, luma.led_matrix and luma.emulator display drivers.
MIT License
367 stars 140 forks source link

Replace usage of deprecated Pillow methods #162

Closed thijstriemstra closed 1 year ago

thijstriemstra commented 1 year ago

found following:

$ grep -Rn "textsize" examples/
./tweet_scroll.py:70:        w, h = draw.textsize(full_text, font)
./image_composition.py:29:            w, h = draw.textsize(text, font)
./demo.py:43:    size = draw.textsize('World!')
./font_awesome.py:152:                w, h = draw.textsize(text=code, font=font)
./greyscale.py:40:                size = draw.textsize("greyscale")
./welcome.py:167:            size = draw.multiline_textsize(t, font)
./welcome.py:170:                size = draw.multiline_textsize(t, font)
./hotspot/common.py:37:    x = width - margin - draw.textsize(text, font=tiny_font)[0]
./hotspot/common.py:42:    x = (width - draw.textsize(text)[0]) / 2
./game_of_life.py:64:                    w, h = draw.textsize("Game of Life")
./savepoint.py:19:    width, height = draw.textsize(message)
./colors.py:35:                size = draw.textsize(color)
./colors.py:55:            size = draw.textsize("rainbow")
./colors.py:74:            size = draw.textsize("gradient")
$ grep -Rn "ANTIALIAS" .
./video.py:45:            img = img.resize(size, PIL.Image.ANTIALIAS)

fixes #158