1
0
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:
Ryan Cramer
2018-02-13 06:02:30 -05:00
parent e73ec872da
commit 5493d5fea6
5 changed files with 164 additions and 7 deletions

View File

@@ -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;

View File

@@ -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;