Change ANTIALIAS to LANCZOS in asset label generator (#604)

This commit is contained in:
Joe Banks
2024-10-29 22:48:19 +00:00
committed by GitHub
parent 6c32db3998
commit 9f910af7eb

View File

@@ -374,7 +374,7 @@ def generate_label(pk):
barcode = Code39(str(obj.asset_id), writer=ImageWriter()) barcode = Code39(str(obj.asset_id), writer=ImageWriter())
logo_size = (200, 200) logo_size = (200, 200)
image.paste(logo.resize(logo_size, Image.ANTIALIAS), box=(5, 5)) image.paste(logo.resize(logo_size, Image.LANCZOS), box=(5, 5))
barcode_image = barcode.render(writer_options={"quiet_zone": 0, "write_text": False}) barcode_image = barcode.render(writer_options={"quiet_zone": 0, "write_text": False})
width, height = barcode_image.size width, height = barcode_image.size
image.paste(barcode_image.crop((0, 0, width, 100)), (int(((size[0] + logo_size[0]) - width) / 2), 40)) image.paste(barcode_image.crop((0, 0, width, 100)), (int(((size[0] + logo_size[0]) - width) / 2), 40))