From 11153b1c778f131e2220572f18f313ec55b15521 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 19 Jul 2014 00:29:57 +0530 Subject: [PATCH] Add imghdr test for webp --- src/calibre/utils/imghdr.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/calibre/utils/imghdr.py b/src/calibre/utils/imghdr.py index fc8d0942d7..cceaf7879f 100644 --- a/src/calibre/utils/imghdr.py +++ b/src/calibre/utils/imghdr.py @@ -68,6 +68,12 @@ def test_tiff(h, f): tests.append(test_tiff) +def test_webp(h, f): + if h[:4] == b'RIFF' and h[8:12] == b'WEBP': + return 'webp' + +tests.append(test_webp) + def test_rgb(h, f): """SGI image library""" if h[:2] == '\001\332':