calculateSize() public static method

Calculates dimensions of resized image.
public static calculateSize ( $srcWidth, $srcHeight, $newWidth, $newHeight, $flags = self::FIT ) : array
return array
Example #1
0
 /**
  * Get min size
  *
  * @param Newscoop\Image\ImageInterface $image
  * @return array
  */
 public function getMinSize(ImageInterface $image)
 {
     list($width, $height) = \Newscoop\Image\ImageService::calculateSize($image->getWidth(), $image->getHeight(), $this->width, $this->height, $this->getFlags());
     $ratio = max($width / (double) $image->getWidth(), $height / (double) $image->getHeight());
     return array($this->width, $this->height);
 }