mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 19:03:30 -05:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user