/** * get source image * * @param ImageInterface $image * * @return string */ public function getImageSource(ImageInterface $image) { $path = $this->getAbsolutePath($image->getPath()); if (!is_file($path)) { throw new IOException(sprintf('Not found image source "%s"', $image->getId())); } return file_get_contents($path); }