Example #1
0
 /**
  * @param \livetyping\hermitage\foundation\entities\Image $image
  * @param string                     $version
  *
  * @return \livetyping\hermitage\foundation\entities\Image
  * @throws \livetyping\hermitage\foundation\exceptions\UnknownVersionNameException
  */
 public function make(Image $image, string $version) : Image
 {
     $config = $this->getVersionConfig($version);
     $manipulator = $this->extractManipulatorNameFromConfig($config);
     $binary = $this->manipulate($image->getBinary(), $manipulator, $config);
     return $image->modify($binary, $version);
 }
Example #2
0
 /**
  * @param \livetyping\hermitage\foundation\entities\Image $image
  *
  * @throws \livetyping\hermitage\foundation\exceptions\ImageNotFoundException
  */
 public function delete(Image $image)
 {
     $this->assertPresent($image->getPath());
     $this->filesystem->deleteDir($image->getDirname());
 }