示例#1
0
 /**
  * {@inheritdoc}
  */
 public function profile(ProfileInterface $profile)
 {
     try {
         $this->imagick->profileImage('icc', $profile->data());
     } catch (\ImagickException $e) {
         throw new RuntimeException(sprintf('Unable to add profile %s to image', $profile->name()), $e->getCode(), $e);
     }
     return $this;
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function profile(ProfileInterface $profile)
 {
     try {
         $this->gmagick->profileimage('ICM', $profile->data());
     } catch (\GmagickException $e) {
         if (false !== strpos($e->getMessage(), 'LCMS encoding not enabled')) {
             throw new RuntimeException(sprintf('Unable to add profile %s to image, be sue to compile graphicsmagick with `--with-lcms2` option', $profile->name()), $e->getCode(), $e);
         }
         throw new RuntimeException(sprintf('Unable to add profile %s to image', $profile->name()), $e->getCode(), $e);
     }
     return $this;
 }