From 25a2178444f58a23b21a96f3c4606a35fbc055c9 Mon Sep 17 00:00:00 2001 From: josch Date: Fri, 30 Aug 2013 11:06:13 +0200 Subject: [PATCH] read offset for width/height reading correctly --- img2pdf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/img2pdf.py b/img2pdf.py index 257eb44..64c4a99 100755 --- a/img2pdf.py +++ b/img2pdf.py @@ -105,7 +105,8 @@ def main(images, dpi, title=None, author=None, creator=None, producer=None, exit(1) # image is jpeg2000 imgformat = "JP2" - im.seek(48) + offset, = struct.unpack(">I", im.read(4)) + im.seek(28+offset) height, width = struct.unpack(">II", im.read(8)) if colorspace: color = colorspace