/** * * @param Image $image * @see \Image\Filter\Resize::filter() */ public function filter(Image $image) { // Scale the dimensions - if they don't change then just return success. if (!$this->dimensionsScale($image)) { return true; } return parent::filter($image); }
/** * * @param Image $image */ private function resize($image) { $scale = max($this->getWidth() / $image->getWidth(), $this->getHeight() / $image->getHeight()); $options = array('width' => $image->getWidth() * $scale, 'height' => $image->getHeight() * $scale); $filter = new Resize(); $filter->setOptions($options); return $filter->filter($image); }