From 013a0dd3d3be5d47befd1bddfc8f35bac77835c5 Mon Sep 17 00:00:00 2001 From: ExtReMLapin <3909752+ExtReMLapin@users.noreply.github.com> Date: Tue, 3 May 2022 17:01:06 +0200 Subject: [PATCH] fixed support for VP8X --- imagesize.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/imagesize.py b/imagesize.py index 9e1960a..f4edd1d 100644 --- a/imagesize.py +++ b/imagesize.py @@ -96,7 +96,7 @@ def get(filepath): fhandle = open(filepath, 'rb') try: - head = fhandle.read(24) + head = fhandle.read(31) size = len(head) # handle GIFs if size >= 10 and head[:6] in (b'GIF87a', b'GIF89a'): @@ -250,10 +250,15 @@ def get(filepath): fhandle.seek(-1, os.SEEK_CUR) width, height = sizes elif head.startswith(b"RIFF") and head[8:12] == b"WEBP": - # enter VP8 chunk - fhandle.seek(26) - width = struct.unpack("