Example #1
0
 /**
  * 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);
 }
 /**
  * Upload image source
  *
  * @param ImageInterface $image
  *
  * @return ImageInterface
  */
 protected function uploadSource(ImageInterface $image)
 {
     if ($binary = $image->getBinarySource()) {
         $image = $this->uploader->uploadBase64($image, $binary);
     }
     return $image;
 }
Example #3
0
 /**
  * Remove child
  *
  * @param ImageInterface $child
  */
 public function removeChild(ImageInterface $child)
 {
     $child->setParent(null);
     $this->childs->removeElement($child);
 }