From 877f494e7ef8482dc21eb8f39346df9f537c1b95 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 27 Oct 2019 22:54:27 -0700 Subject: [PATCH] more support for image/webp in gd --- Zotlabs/Photo/PhotoGd.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Zotlabs/Photo/PhotoGd.php b/Zotlabs/Photo/PhotoGd.php index 1feeaff79..d7727be61 100644 --- a/Zotlabs/Photo/PhotoGd.php +++ b/Zotlabs/Photo/PhotoGd.php @@ -22,6 +22,9 @@ class PhotoGd extends PhotoDriver { if (imagetypes() & IMG_GIF) { $t['image/gif'] = 'gif'; } + if (imagetypes() & IMG_WEBP) { + $t['image/webp'] = 'webp'; + } return $t; } @@ -160,6 +163,11 @@ class PhotoGd extends PhotoDriver { ob_start(); switch ($this->getType()){ + case 'image/webp': + + \imagewebp($this->image); + break; + case 'image/png': $quality = get_config('system', 'png_quality'); if ((! $quality) || ($quality > 9)) {