function yttags_webp2png($src_file_path, $file_destination_path, $compression_qty = 100) { $image = imagecreatefromwebp($src_file_path); $final_output = imagepng($image, $file_destination_path, $compression_qty); if (false === $final_output) { return false; } imagedestroy($image); return $file_destination_path; }
Function usage:
echo yttags_webp2png('img/oldfile.webp','img/newfile.png',9);