read offset for width/height reading correctly

This commit is contained in:
josch 2013-08-30 11:06:13 +02:00
parent 2e9ac9ec1e
commit 25a2178444

View file

@ -105,7 +105,8 @@ def main(images, dpi, title=None, author=None, creator=None, producer=None,
exit(1) exit(1)
# image is jpeg2000 # image is jpeg2000
imgformat = "JP2" imgformat = "JP2"
im.seek(48) offset, = struct.unpack(">I", im.read(4))
im.seek(28+offset)
height, width = struct.unpack(">II", im.read(8)) height, width = struct.unpack(">II", im.read(8))
if colorspace: if colorspace:
color = colorspace color = colorspace