skip any number extraneous chars at the end of chunks

This commit is contained in:
homm 2015-07-06 19:05:08 +03:00
parent 8c3f66a9ae
commit 0b19a86087
2 changed files with 2 additions and 2 deletions

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB