[Badges] Missed a few more pillow 10.0 changes

This commit is contained in:
TrustyJAID committed 2023-07-08 08:58:57 -06:00
1 parent dc0f28140a
commit dacf341060
2 files changed
+4 -3

No files matched your search

+2 -2
View File
@@ -141,7 +141,7 @@ class Badges(commands.Cog):
barcode = self.invert_barcode(barcode)
template = template.convert("RGBA")
barcode = barcode.convert("RGBA")
barcode = barcode.resize((555, 125), Image.ANTIALIAS)
barcode = barcode.resize((555, 125), Image.LANCZOS)
template.paste(barcode, (400, 520), barcode)
# font for user information
font_loc = str(bundled_data_path(self) / "arial.ttf")
@@ -190,7 +190,7 @@ class Badges(commands.Cog):
id_image = frame.resize((165, 165))
temp2.paste(watermark, (845, 45, 945, 145), watermark)
temp2.paste(id_image, (60, 95, 225, 260))
temp2.thumbnail((500, 339), Image.ANTIALIAS)
temp2.thumbnail((500, 339), Image.LANCZOS)
img_list.append(temp2)
num += 1
temp = BytesIO()
+2 -1
View File
@@ -410,7 +410,8 @@ else:
def _paint_text(self, xpos, ypos):
font = ImageFont.truetype(self.FONT, self.font_size * 2)
width, height = font.getsize(self.text)
top, left, bottom, right = font.getbbox(text=self.text)
width, height = (bottom - top, right - left)
pos = (mm2px(xpos, self.dpi) - width // 2, mm2px(ypos, self.dpi) - height // 4)
self._draw.text(pos, self.text, font=font, fill=self.foreground)