Exemple #1
0
 /**
  *
  * @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);
 }
Exemple #2
0
 /**
  *
  * @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);
 }