Hello guys i'm using batflat for a small project. The thing is want to save/display webP images too, How can it enabled/possible?. I try imagecreatefromwebp without luck. Any idea/help will be awesome. Gracias!
/**
* Saves image
*
* @param string $path Path to location
* @param string $type Filetype
* @return boolean true if image was saved
* @access public
*/
public function save($path, $quality = 90)
{
$dir = dirname($path);
$type = pathinfo($path, PATHINFO_EXTENSION);
if (!file_exists($dir) || !is_dir($dir)) {
return false;
}
if (!is_writable($dir)) {
return false;
}
if ($type != 'gif' && $type != 'jpeg' && $type != 'jpg' && $type != 'png') {
$type = $this->type;
$path .= '.'.$type;
}
switch ($type) {
case 'gif':
imagegif($this->image, $path);
break;
case 'jpeg': case 'jpg':
imagejpeg($this->image, $path, $quality);
break;
default:
imagepng($this->image, $path);
}
return true;
}
full code: https://github.com/sruupl/batflat/blob/master/inc/core/lib/Image.php