From aed682305173a67b2af1a56b8595445bec690e2b Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Sat, 7 Dec 2019 20:14:17 +0100 Subject: Add .webp image format support --- boot.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index bc1e2a319..c98ab007d 100755 --- a/boot.php +++ b/boot.php @@ -104,6 +104,11 @@ define ( 'JPEG_QUALITY', 100 ); */ define ( 'PNG_QUALITY', 8 ); +/** + * App::$config['system']['webp_quality'] from 1 (maximum compressed) to 100 (uncompressed) + */ +define ( 'WEBP_QUALITY', 80 ); + /** * Language detection parameters */ @@ -899,11 +904,12 @@ class App { // Serve raw files from the file system in certain cases. $filext = pathinfo(self::$cmd, PATHINFO_EXTENSION); - $serve_rawfiles=[ + $serve_rawfiles = [ 'jpg'=>'image/jpeg', 'jpeg'=>'image/jpeg', 'gif'=>'image/gif', 'png'=>'image/png', + 'webp'=>'image/webp', 'ico'=>'image/vnd.microsoft.icon', 'css'=>'text/css', 'js'=>'text/javascript', @@ -913,7 +919,8 @@ class App { 'ttf'=>'font/ttf', 'woff'=>'font/woff', 'woff2'=>'font/woff2', - 'svg'=>'image/svg+xml']; + 'svg'=>'image/svg+xml' + ]; if (array_key_exists($filext, $serve_rawfiles) && file_exists(self::$cmd)) { $staticfilecwd = getcwd(); -- cgit v1.2.3