1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-18 20:41:16 +02:00

cleaning and beautyfying

This commit is contained in:
horst-n
2019-04-27 10:46:39 +02:00
parent a4431829d9
commit 1b96368aa2
2 changed files with 3 additions and 2 deletions

View File

@@ -1262,6 +1262,7 @@ abstract class ImageSizerEngine extends WireData implements Module, Configurable
$options = array(
'quality' => $this->quality,
'webpQuality' => $this->webpQuality,
'webpAdd' => $this->webpAdd,
'cropping' => $this->cropping,
'upscaling' => $this->upscaling,
'interlace' => $this->interlace,

View File

@@ -413,8 +413,8 @@ class ImageSizerEngineGD extends ImageSizerEngine {
*/
protected function imSaveWebP($im, $filename, $quality = 90) {
if(!function_exists('imagewebp')) return false;
$path_parts = pathinfo($filename);
$webpFilename = $path_parts['dirname'] . '/' . $path_parts['filename'] . '.webp';
$path_parts = pathinfo($filename);
$webpFilename = $path_parts['dirname'] . '/' . $path_parts['filename'] . '.webp';
if(file_exists($webpFilename)) $this->wire('files')->unlink($webpFilename);
return imagewebp($im, $webpFilename, $quality);
}