mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-22 15:24:37 +03:00
Assert JpegIFByteCount is int
This commit is contained in:
parent
5ad98e7abb
commit
34762ded75
|
@ -191,7 +191,10 @@ class ImageFile(Image.Image):
|
||||||
if thumbnail_offset is not None:
|
if thumbnail_offset is not None:
|
||||||
thumbnail_offset += getattr(self, "_exif_offset", 0)
|
thumbnail_offset += getattr(self, "_exif_offset", 0)
|
||||||
self.fp.seek(thumbnail_offset)
|
self.fp.seek(thumbnail_offset)
|
||||||
data = self.fp.read(ifd.get(ExifTags.Base.JpegIFByteCount))
|
|
||||||
|
length = ifd.get(ExifTags.Base.JpegIFByteCount)
|
||||||
|
assert isinstance(length, int)
|
||||||
|
data = self.fp.read(length)
|
||||||
fp = io.BytesIO(data)
|
fp = io.BytesIO(data)
|
||||||
|
|
||||||
with Image.open(fp) as im:
|
with Image.open(fp) as im:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user