$original_path = '../..'.Config::get('constant.ORIGINAL_IMAGES_DIRECTORY');
$path = $original_path.$img;
//convert image into .webp format
$file_data = pathinfo(basename($path));
$webp_name = $file_data['filename'];
$webp_path = '../..' . Config::get('constant.WEBP_ORIGINAL_IMAGES_DIRECTORY').$webp_name.'.webp';
$webp = Image::make($path);
$webp->save($webp_path, 75);
但是与原始图像相比,它增加了webp图像的文件大小。有人有解决方案吗?
我的原始图片大小为199kb(https://imgur.com/IQxwCX2) 将图像转换为webp扩展名后,文件大小为321kb