/** * @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); }
/** * @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()); }