mirror of
https://github.com/processwire/processwire.git
synced 2025-08-21 22:06:12 +02:00
Add @horst-n support for focus zoom setting in the ImageSizerEngines
This commit is contained in:
@@ -127,6 +127,13 @@ class ImageSizerEngineAnimatedGif extends ImageSizerEngine {
|
||||
|
||||
$this->setTimeLimit(120);
|
||||
|
||||
$zoom = $this->getFocusZoomPercent();
|
||||
if($zoom > 1) {
|
||||
// we need to configure a cropExtra call to respect the zoom factor
|
||||
$this->cropExtra = $this->getFocusZoomCropDimensions($zoom, $fullWidth, $fullHeight, $finalWidth, $finalHeight);
|
||||
$this->cropping = false;
|
||||
}
|
||||
|
||||
// if extra crop manipulation is requested, it is processed first
|
||||
if(is_array($this->cropExtra) && 4 == count($this->cropExtra)) { // crop before resize
|
||||
list($cropX, $cropY, $cropWidth, $cropHeight) = $this->cropExtra;
|
||||
|
@@ -289,6 +289,13 @@ class ImageSizerEngineIMagick extends ImageSizerEngine {
|
||||
}
|
||||
}
|
||||
|
||||
$zoom = $this->getFocusZoomPercent();
|
||||
if($zoom > 1) {
|
||||
// we need to configure a cropExtra call to respect the zoom factor
|
||||
$this->cropExtra = $this->getFocusZoomCropDimensions($zoom, $fullWidth, $fullHeight, $finalWidth, $finalHeight);
|
||||
$this->cropping = false;
|
||||
}
|
||||
|
||||
if(is_array($this->cropExtra) && 4 == count($this->cropExtra)) { // crop before resize
|
||||
list($cropX, $cropY, $cropWidth, $cropHeight) = $this->cropExtra;
|
||||
#list($x, $y, $w, $h) = $this->cropExtra;
|
||||
|
Reference in New Issue
Block a user