From 5aecf2019030b351d7ef9c1f37436972523665f3 Mon Sep 17 00:00:00 2001 From: Tim Koop <10602476+cyanPaperclip@users.noreply.github.com> Date: Thu, 13 Apr 2023 10:34:02 +0200 Subject: [PATCH] fix webp Tested with PHP 8.0. Otherwise got error 'PHP Warning: imagewebp(): Palette image not supported by webp' and an empty HTTP response. --- code.php | 1 + 1 file changed, 1 insertion(+) diff --git a/code.php b/code.php index 5ef6871..c5b70e3 100755 --- a/code.php +++ b/code.php @@ -276,6 +276,7 @@ function process_output_buffer( $buffer = '' ) { if ( ! function_exists( 'imagewebp' ) ) { die( $file_format . ' is not supported!' ); } + imagepalettetotruecolor( $img ); imagewebp( $img ); break;