/** * {@inheritdoc} */ public function remove(ImageInterface $image, $save = false) { if (isset($this->images[spl_object_hash($image)])) { unset($this->images[spl_object_hash($image)]); } $this->defaultManager->remove($image, $save); }
/** * Reverse transform. * * @param ImageInterface $image * * @return ImageInterface * * @throws TransformationFailedException */ public function reverseTransform($image) { if (null === $image) { return null; } $filename = $image->getFilename(); if (empty($filename)) { return null; } if ($this->preFilename && $this->preFilename !== $filename) { $this->imageManager->remove($image); } $image = $this->imageManager->findByFilename($filename); if (null === $image) { throw new TransformationFailedException(); } $image->setTemporary(false); return $image; }