Fix JPEG DPI: Pillow expects dpi=(x,y)

This commit is contained in:
James R. Barlow
2016-02-16 07:29:20 -08:00
parent ab3c1988c1
commit 60b2eb1455
+4 -1
View File
@@ -677,7 +677,10 @@ def select_image_for_pdf(
if all(image['enc'] == 'jpeg' for image in pageinfo['images']):
# If all images were JPEGs originally, produce a JPEG as output
im = Image.open(image)
dpi = im.info.get('dpi', int(pageinfo['xres']))
dpi = im.info.get(
'dpi',
(int(pageinfo['xres']), int(pageinfo['yres']))
)
im.save(output_file, format='JPEG', dpi=dpi)
else:
re_symlink(image, output_file)