Exemplo n.º 1
0
 /**
  * @param ImageInterface $image
  * @param ConfigInterface $versionConfig
  *
  * @return ImageInterface
  */
 protected function createImageVersion(ImageInterface $image, ConfigInterface $versionConfig)
 {
     $width = $versionConfig->getWidth();
     if ($width === 0) {
         $width = PHP_INT_MAX;
     }
     $height = $versionConfig->getHeight();
     if ($height === 0) {
         $height = PHP_INT_MAX;
     }
     $image = $image->thumbnail(new Box($width, $height), $versionConfig->isFit() ? ImageInterface::THUMBNAIL_INSET : ImageInterface::THUMBNAIL_OUTBOUND);
     return $image;
 }