read offset for width/height reading correctly
This commit is contained in:
parent
2e9ac9ec1e
commit
25a2178444
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue