private function createImagePath($name, $resolution, $method) { if ($image = $this->local->createImagePath($name, $resolution, $method)) { return $image; } elseif ($this->remote && ($image = $this->remote->createImagePath($resolution, $name, $method))) { return $image; } return $this->placehold->createImagePath($resolution); }
/** * @param string $name * @param string $resolution * @param int $method * @return ImagePath */ public function createImagePath($name, $resolution, $method) { $thumbFile = $this->path->getFilesystem($name, $resolution, $method); if (is_file($thumbFile)) { return new ImagePath($this->getPathUrl($name, $resolution, $method), $thumbFile); } $sourceImage = $this->path->getSourceDir($name); if (!is_file($sourceImage)) { return $this->placehold->createImagePath($resolution); } return $this->saveFile(Utils\Image::fromFile($sourceImage), $name, $resolution, $method); }