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