SeedSigner / seedsigner

Use an air-gapped Raspberry Pi Zero to sign for Bitcoin transactions! (and do other cool stuff)
MIT License
699 stars 161 forks source link

pillow-9 deprecation warnings: like pr#475 #497

Closed jdlcdl closed 12 months ago

jdlcdl commented 1 year ago

Description

Removes Pillow 10 deprecation warnings, seen since 9.4, when running screenshot generator.

This pull request is categorized as a:

Checklist

If you modified or added functionality/workflow, did you add new unit tests?

I have tested this PR on the following platforms/os:

kdmukai commented 1 year ago

The swap from getsize() to getbbox() looks guaranteed to be pixel-for-pixel identical, based on how Pillow implemented getbbox()

So I don't see any risks of unintended side effects to these changes.

Kind of a weird deprecation on their part, given that they're still using self.font.getsize() under the hood even in the the main branch.

Whoops, wait, we use FreeTypeFont. A bit harder to decipher what it's doing w/the self.font.getsize() data. https://github.com/python-pillow/Pillow/blob/9.4.0/src/PIL/ImageFont.py#L181-L196

jdlcdl commented 12 months ago

Im just now realizing that this pr is a duplicate of #485

Ooops... closed.