Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions yii/image/drivers/Kohana/Image/GD.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ public function __construct($file)
case IMAGETYPE_PNG:
$create = 'imagecreatefrompng';
break;
case IMAGETYPE_WEBP:
$create = 'imagecreatefromwebp';
break;
}

if ( ! isset($create) OR ! function_exists($create))
Expand Down Expand Up @@ -657,6 +660,11 @@ protected function _save_function($extension, & $quality)
// Use a compression level of 9 (does not affect quality!)
$quality = 9;
break;
case 'webp':
// Save a WEBP file
$save = 'imagewebp';
$type = IMAGETYPE_WEBP;
break;
default:
throw new ErrorException(sprintf('Installed GD does not support %s images',$extension));
break;
Expand Down