Fix rawdata[:12] bytes/str comparison
This commit is contained in:
parent
725462462b
commit
b54617de19
1 changed files with 1 additions and 1 deletions
|
@ -671,7 +671,7 @@ def read_images(rawdata, colorspace, first_frame_only=False):
|
||||||
imgdata = Image.open(im)
|
imgdata = Image.open(im)
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
# test if it is a jpeg2000 image
|
# test if it is a jpeg2000 image
|
||||||
if rawdata[:12] != "\x00\x00\x00\x0C\x6A\x50\x20\x20\x0D\x0A\x87\x0A":
|
if rawdata[:12] != b"\x00\x00\x00\x0C\x6A\x50\x20\x20\x0D\x0A\x87\x0A":
|
||||||
raise ImageOpenError("cannot read input image (not jpeg2000). "
|
raise ImageOpenError("cannot read input image (not jpeg2000). "
|
||||||
"PIL: error reading image: %s" % e)
|
"PIL: error reading image: %s" % e)
|
||||||
# image is jpeg2000
|
# image is jpeg2000
|
||||||
|
|
Loading…
Reference in a new issue