From 31a2ce231fa5ff6d57574783020f0a4431649748 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Wed, 10 Feb 2016 09:44:12 +0100 Subject: [PATCH] cap the maximum page size at 200 dpi which is the maximum supported by PDF --- src/img2pdf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/img2pdf.py b/src/img2pdf.py index 8f7f3ed..08cb9fe 100755 --- a/src/img2pdf.py +++ b/src/img2pdf.py @@ -857,6 +857,9 @@ def convert(*images, title=None, if pagewidth < 3.00 or pageheight < 3.00: logging.warning("pdf width or height is below 3.00 - too small " "for some viewers!") + elif pagewidth > 14400.0 or pageheight > 14400.0: + logging.error("pdf width or height must not exceed 200 inches.") + exit(1) # the image is always centered on the page imgxpdf = (pagewidth - imgwidthpdf)/2.0 imgypdf = (pageheight - imgheightpdf)/2.0