Merge pull request #1337 from homm/extraneous-jpeg-bytes

Skip any number extraneous chars at the end of JPEG chunks
This commit is contained in:
wiredfool 2015-09-10 15:39:55 +01:00
commit 60f44f2dce
2 changed files with 2 additions and 2 deletions

View File

@ -288,7 +288,7 @@ class JpegImageFile(ImageFile.ImageFile):
s = self.fp.read(1)
if i8(s[0]) != 255:
if i8(s) != 255:
raise SyntaxError("not a JPEG file")
# Create attributes
@ -311,7 +311,7 @@ class JpegImageFile(ImageFile.ImageFile):
i = i16(s)
else:
# Skip non-0xFF junk
s = b"\xff"
s = self.fp.read(1)
continue
if i in MARKER:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB