Fix failure to convert palette-based PNG to WebP #2608

This commit is contained in:
Kijin Sung 2025-10-22 15:21:36 +09:00
parent fd0e2a1cc3
commit f3494e8a11

View file

@ -728,6 +728,10 @@ class FileHandler
} }
elseif ($target_type === 'webp' && function_exists('imagewebp')) elseif ($target_type === 'webp' && function_exists('imagewebp'))
{ {
if (!imageistruecolor($thumb))
{
imagepalettetotruecolor($thumb);
}
$output = imagewebp($thumb, $target_file); $output = imagewebp($thumb, $target_file);
} }
else else