From e7c81aa290e6832754dc8eaa911d831a381135c7 Mon Sep 17 00:00:00 2001 From: ExtReMLapin <3909752+ExtReMLapin@users.noreply.github.com> Date: Tue, 3 May 2022 17:20:07 +0200 Subject: [PATCH] Update imagesize.py --- imagesize.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/imagesize.py b/imagesize.py index f4edd1d..e6ed07e 100644 --- a/imagesize.py +++ b/imagesize.py @@ -250,15 +250,17 @@ def get(filepath): fhandle.seek(-1, os.SEEK_CUR) width, height = sizes elif head.startswith(b"RIFF") and head[8:12] == b"WEBP": - if head[12:16] == b"VP8L": - raise ValueError("Invalid WEBP file: Not a WebP file.") - elif head[12:16] == b"VP8 ": + if head[12:16] == b"VP8 ": width, height = struct.unpack("> 6)) + 1 else: - raise ValueError("Invalid WEBP file: Not a WebP file.") + raise ValueError("Unsupported WebP file") finally: fhandle.close() -- 2.39.0.windows.2