blockdiag / seqdiag

Apache License 2.0
66 stars 13 forks source link

Seqdiag/Blockdiag fails with Pillow 10.0.0 #63

Open rdante-dhar opened 1 year ago

rdante-dhar commented 1 year ago

Looks like the seqdiag/blockdiag uses ImageDraw.textsize() but it seems it was removed with Pillow 10.0.0 Check here: https://pillow.readthedocs.io/en/stable/releasenotes/10.0.0.html#font-size-and-offset-methods

Because of this we get the following exceptions:

File "/venv/lib/python3.11/site-packages/blockdiag/imagedraw/png.py", line 276, in textlinesize size = self.draw.textsize(string, font=None) ^^^^^^^^^^^^^^^^^^ AttributeError: 'ImageDraw' object has no attribute 'textsize'

Note:- This works if we revert to Pillow version 9.5.0

ViktorHaag commented 11 months ago

Blockdiag has a PR in flight to address a similar issue; I wonder if that PR's contents could also be applied to this project (and potentially the other blockdiag-related projects)?

See: https://github.com/blockdiag/blockdiag/pull/179