TippingCanoe\Imager\Storage\Filesystem::tempOriginal PHP Метод

tempOriginal() публичный Метод

Tells the driver to prepare a copy of the original image locally.
public tempOriginal ( Image $image ) : File
$image TippingCanoe\Imager\Model\Image
Результат Symfony\Component\HttpFoundation\File\File
    public function tempOriginal(Image $image)
    {
        $originalPath = sprintf('%s/%s-%s.%s', $this->root, $image->getKey(), $this->generateHash($image), Mime::getExtensionForMimeType($image->mime_type));
        $tempOriginalPath = tempnam(sys_get_temp_dir(), null);
        if (!copy($originalPath, $tempOriginalPath)) {
            throw new \Exception('Imager couldn\'t copy the original image to the temporary location');
        }
        return new File($tempOriginalPath);
    }