add check for WebP support

Signed-off-by: tastytea <tastytea@tastytea.de>
This commit is contained in:
tastytea 2023-02-02 21:13:26 +01:00
parent ba126f6f1b
commit d9ade4ba6e
No known key found for this signature in database
1 changed files with 11 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2014-2016,2023 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from PIL.features import check_codec
from PIL.features import check_codec, check_module
# check for JPEG support.
if not check_codec("jpg"):
@ -30,3 +30,12 @@ if not check_codec("zlib"):
" 'sudo apt-get install libjpeg-dev' then 'pip uninstall pillow &&"
" pip install pillow --user'"
)
# check for WebP support.
if not check_module("webp"):
raise Exception(
"FATAL: webp module not supported. Install pillow correctly! "
" 'sudo apt-get install libwebp-dev' then 'pip uninstall pillow &&"
" pip install pillow --user'"
)