Skip to content

Commit

Permalink
Merge pull request #145 from mitre-attack/fix/140-pillow
Browse files Browse the repository at this point in the history
Update compatibility with Pillow 10.0.0
  • Loading branch information
jondricek authored Sep 13, 2023
2 parents e23635e + 64772f5 commit 797960f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mitreattack/navlayers/exporters/svg_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _getstringwidth(string, font, size):
:return: pixel length of string
"""
font = ImageFont.truetype(f"{os.path.sep.join(__file__.split(os.path.sep)[:-1])}/fonts/{font}.ttf", int(size))
length, _ = font.getsize(string)
length, _ = font.getbbox(string)[2:4]
return length


Expand All @@ -51,7 +51,7 @@ def _getstringheight(string, font, size):
:return: pixel height of string
"""
font = ImageFont.truetype(f"{os.path.sep.join(__file__.split(os.path.sep)[:-1])}/fonts/{font}.ttf", int(size))
_, height = font.getsize(string)
_, height = font.getbbox(string)[2:4]
return height


Expand Down

0 comments on commit 797960f

Please sign in to comment.