Improve image quality of PNGs

The PNGs we were generating looked a bit fuzzy, and the text rendering
was a bit off.

This is because we weren’t rendering them at a high enough resolution.
I’m guessing the default was 72dpi. This commit increases the resolution
to 96dpi, which (locally) seems to be enough to give a good-looking
preview.
This commit is contained in:
Chris Hill-Scott
2016-12-28 11:07:22 +00:00
parent 2854dbe3dd
commit 729568d010

View File

@@ -264,7 +264,8 @@ def get_template(
def png_from_pdf(pdf_endpoint):
output = BytesIO()
with Image(
blob=pdf_endpoint.get_data()
blob=pdf_endpoint.get_data(),
resolution=96,
) as image:
with image.convert('png') as converted:
converted.save(file=output)