/**
  * @param \Carrooi\ImagesManager\Image\Image $image
  * @param int|null $width
  * @param int|null $height
  * @param int|null $resizeFlag
  * @return string
  */
 public function getImageUrl(Image $image, $width = null, $height = null, $resizeFlag = null)
 {
     $name = pathinfo($image->getName(), PATHINFO_FILENAME);
     $ext = pathinfo($image->getName(), PATHINFO_EXTENSION);
     return 'http://localhost/' . $image->getNamespace() . '/' . $name . ($width ? '_w' . $width : '') . ($height ? '_h' . $height : '') . (($width || $height) && $resizeFlag !== null ? '_f' . $resizeFlag : '') . '.' . $ext;
 }
 /**
  * @param \Carrooi\ImagesManager\Image\Image $image
  * @param int|null $width
  * @param int|null $height
  * @param int|null $resizeFlag
  * @return \Nette\Utils\Image
  */
 public function tryStoreThumbnail(Image $image, $width = null, $height = null, $resizeFlag = null)
 {
     $resizeFlag = $resizeFlag === null ? $this->config->getResizeFlag($image->getNamespace()) : $resizeFlag;
     if ($this->storage->isImageExists($image, $width, $height, $resizeFlag)) {
         return $this->storage->getNetteImage($image, $width, $height, $resizeFlag);
     }
     $img = $this->storage->getNetteImage($image);
     $img->resize($width, $height, $resizeFlag);
     $quality = $this->config->getQuality($image->getNamespace());
     $this->storage->tryStoreThumbnail($image, $img, $width, $height, $resizeFlag, $quality);
     return $img;
 }
 /**
  * @param \Carrooi\ImagesManager\Image\Image $image
  * @param string $separator
  * @param int|null $width
  * @param int|null $height
  * @param int|null $resizeFlag
  * @return string
  */
 private function createBaseImagePath(Image $image, $separator, $width = null, $height = null, $resizeFlag = null)
 {
     $name = pathinfo($image->getName(), PATHINFO_FILENAME);
     $ext = pathinfo($image->getName(), PATHINFO_EXTENSION);
     return $image->getNamespace() . $separator . $name . ($width ? '_w' . $width : '') . ($height ? '_h' . $height : '') . (($width || $height) && $resizeFlag !== null ? '_f' . $resizeFlag : '') . '.' . $ext;
 }