Commit 8106b05a authored by Ben Hayward's avatar Ben Hayward

Lint

1 merge request!391[Sprint/RollingRabbit](fix): Updated returned exception of offending spam link. #1104
Pipeline #94744808 failed with stages
in 2 minutes and 48 seconds
......@@ -128,39 +128,44 @@ class Resize
$params = $this->getResizeParameters();
// If is animated,
if ($this->image->getNumberImages() > 1) {
foreach ($this->image as $frame) {
// Crop into square.
$frame->cropImage(
// if ($this->image->getNumberImages() > 1) {
$this->image = $this->image->coalesceImages();
foreach ($this->image as $frame) {
error_log("processing frame...");
// Crop into square.
$frame->cropImage(
$params['selectionwidth'],
$params['selectionheight'],
$params['xoffset'],
$params['yoffset']
);
// Resize canvas to new image
$frame->setImagePage(0, 0, 0, 0);
// If selected with / height differ from selection width/height, then we need to resize
if ($params['selectionwidth'] !== $params['newwidth'] || $params['selectionheight'] !== $params['newheight']) {
$frame->thumbnailImage($params['newwidth'], $params['newheight']);
}
}
} else {
// Crop the image to selection dimensions
$this->image->cropImage(
$params['selectionwidth'],
$params['selectionheight'],
$params['xoffset'],
$params['yoffset']
);
// Resize canvas to new image
$frame->setImagePage(0, 0, 0, 0);
// If selected with / height differ from selection width/height, then we need to resize
if ($params['selectionwidth'] !== $params['newwidth'] || $params['selectionheight'] !== $params['newheight']) {
$this->image->thumbnailImage($params['newwidth'], $params['newheight']);
$frame->thumbnailImage($params['newwidth'], $params['newheight']);
}
}
$this->image = $this->image->deconstructImages();
// } else {
// // Crop the image to selection dimensions
// $this->image->cropImage(
// $params['selectionwidth'],
// $params['selectionheight'],
// $params['xoffset'],
// $params['yoffset']
// );
// // If selected with / height differ from selection width/height, then we need to resize
// if ($params['selectionwidth'] !== $params['newwidth'] || $params['selectionheight'] !== $params['newheight']) {
// $this->image->thumbnailImage($params['newwidth'], $params['newheight']);
// }
// }
$this->output = $this->image;
return $this;
......
Please register or to comment