From c76c63ab727a4d0defd0656c9fb637d373a10a90 Mon Sep 17 00:00:00 2001 From: josch Date: Sat, 16 Nov 2013 23:13:38 +0100 Subject: [PATCH] do not overwrite dpi variable --- img2pdf.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/img2pdf.py b/img2pdf.py index e1f5517..c14d398 100755 --- a/img2pdf.py +++ b/img2pdf.py @@ -208,11 +208,11 @@ def main(images, dpi, title=None, author=None, creator=None, producer=None, imgformat = "JP2" if dpi: - dpi = dpi, dpi - debug_out("input dpi (forced) = %d x %d"%dpi) + ndpi = dpi, dpi + debug_out("input dpi (forced) = %d x %d"%ndpi) else: - dpi = (96, 96) # TODO: read real dpi - debug_out("input dpi = %d x %d"%dpi) + ndpi = (96, 96) # TODO: read real dpi + debug_out("input dpi = %d x %d"%ndpi) if colorspace: color = colorspace @@ -225,11 +225,11 @@ def main(images, dpi, title=None, author=None, creator=None, producer=None, imgformat = imgdata.format if dpi: - dpi = dpi, dpi - debug_out("input dpi (forced) = %d x %d"%dpi) + ndpi = dpi, dpi + debug_out("input dpi (forced) = %d x %d"%ndpi) else: - dpi = imgdata.info.get("dpi", (96, 96)) - debug_out("input dpi = %d x %d"%dpi) + ndpi = imgdata.info.get("dpi", (96, 96)) + debug_out("input dpi = %d x %d"%ndpi) if colorspace: color = colorspace @@ -255,7 +255,7 @@ def main(images, dpi, title=None, author=None, creator=None, producer=None, color = 'L' imgdata = zlib.compress(imgdata.tostring()) - pdf.addimage(color, width, height, dpi, imgformat, imgdata) + pdf.addimage(color, width, height, ndpi, imgformat, imgdata) im.close()