1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-18 04:22:10 +02:00

add property and method for webpAdd

This commit is contained in:
horst-n
2019-04-25 08:59:58 +02:00
parent 8a63886da1
commit 4e534e0315

View File

@@ -69,6 +69,14 @@ abstract class ImageSizerEngine extends WireData implements Module, Configurable
*/ */
protected $webpQuality = 90; protected $webpQuality = 90;
/**
* Also create a WebP Image with this variation?
*
* @var bool
*
*/
protected $webpAdd = false;
/** /**
* Image interlace setting, false or true * Image interlace setting, false or true
* *
@@ -915,6 +923,19 @@ abstract class ImageSizerEngine extends WireData implements Module, Configurable
return $this; return $this;
} }
/**
* Set flag to also create a webp file or not
*
* @param bool $value
*
* @return $this
*
*/
public function setWebpAdd($value) {
$this->webpAdd = (bool) $value;
return $this;
}
/** /**
* Given an unknown sharpening value, return the string representation of it * Given an unknown sharpening value, return the string representation of it
* *
@@ -1178,6 +1199,9 @@ abstract class ImageSizerEngine extends WireData implements Module, Configurable
case 'webpQuality': case 'webpQuality':
$this->setWebpQuality($value); $this->setWebpQuality($value);
break; break;
case 'webpAdd':
$this->setWebpAdd($value);
break;
case 'cropping': case 'cropping':
$this->setCropping($value); $this->setCropping($value);
break; break;