Convert screenshots to jpg so more of them can fit in an email body

This commit is contained in:
Kuba Orlik 2022-08-25 17:28:29 +02:00
parent 5f6991b08f
commit edcc966ab9

View File

@ -113,9 +113,9 @@ with Image.open(output_file) as im:
im = im.crop((0, 24, 2880, 1588))
im = im.resize((im.width // 2, im.height // 2))
thumbnail = im.resize((im.width // 5, im.height // 5))
output_filename = domain.replace(".", "_") + "_" + output_suffix
output_filename = domain.replace(".", "_") + "_" + output_suffix.replace("png", "jpg")
thumbnail_filename = domain.replace(".", "_") + "_thumb_" + output_suffix.replace("png", "jpg")
im.save(output_dir + "/" + output_filename, "PNG")
im.save(output_dir + "/" + output_filename, "JPEG")
thumbnail.save(output_dir + "/" + thumbnail_filename, "JPEG")
print(json.dumps({"new_file":
{