Get the image's final location

@return \PhingFile
@throws \IOException
@throws \NullPointerException
489122
protected function resolveImageDestination(): PhingFile
    {
        $phingFile = $this->getProject()->getProperty('phing.file');
        $format = $this->getFormat();
        $candidate = $this->getDestination();
        $path = $this->resolveDestination($phingFile, $format, $candidate);

        return new PhingFile($path);
    }
66463
protected function getTemporaryImageBasePath()
	{
		$basePath = $this->getImageBasePath();

		$temporaryPath = $basePath . '/'. $this->temporaryPath;

		if (!File::exists($temporaryPath)) {
			File::makeDirectory($temporaryPath, 0755, true);
		}

		return $temporaryPath;
	}
808070
protected function saveImage()
    {
        if (!$this->image) {
            return parent::path(false);
        }

        $this->filter();

        if (isset($this->result)) {
            return $this->result;
        }

        if (!$this->debug_watermarked && $this->get('debug')) {
            $ratio = $this->get('ratio');
            if (!$ratio) {
                $ratio = 1;
            }

            $locator = Grav::instance()['locator'];
            $overlay = $locator->findResource("system://assets/responsive-overlays/{$ratio}x.png") ?: $locator->findResource('system://assets/responsive-overlays/unknown.png');
            $this->image->merge(ImageFile::open($overlay));
        }

        return $this->image->cacheFile($this->format, $this->quality, false, [$this->get('width'), $this->get('height'), $this->get('modified')]);
    }
1021008
protected function getImageUrlOrDefault()
    {
        $imagePath = $this->entity->path;

        if (!Storage::exists($imagePath)) {
            $imagePath = $this->imgNotFound();
        }

        return Storage::url($imagePath);
    }
1149651
public function getAsImage()
    {
        if ($this->asImage === null) {
            $this->asImage = $this->getGenerator()->generateImage($this);;
        }
        return $this->asImage;
    }
418709
public function getOutputFile()
    {
        if (!$this->outputFile) {
            $dir = rtrim(dirname($this->getFile()), '/\\');
            $file = basename($this->getFile());
            $basename = substr($file, 0, strpos($file, '.'));
            $this->outputFile = $dir.'/'.$basename.'.bmp';
        }
        return $this->outputFile;
    }
918668
protected function get_file() {
        if (!$this->file) {
            return null;
        }
        // The get_file_by_id call can return false, so normalise to null.
        $file = get_file_storage()->get_file_by_id($this->file);
        return ($file) ? $file : null;
    }
950615
protected function getResizedImagePath()
    {
        $resizedImagePath = "";
        $dir = $this->getImageDir();
        $name = $this->getResizedImageName();

        if ($dir && $name) {
            $resizedImagePath = $dir . $name;
        }

        return $resizedImagePath;
    }
6421
public function getPath()
    {
        if($this->getType() == 'memory') {
            $this->_path = parse_url($this->_path, PHP_URL_PATH);
        }

        if($this->getType() == 'temp')
        {
            if(!$this->getResource()) {
                $this->_path = $this->getTemporaryFile();
            }
        }

        return parent::getPath();
    }
225042
public function getImage()
    {
        // No fields, no image.
        if (empty($this->contenttype['fields'])) {
            return '';
        }

        // Grab the first field of type 'image', and return that.
        foreach ($this->contenttype['fields'] as $key => $field) {
            if ($field['type'] === 'image' && isset($this->values[$key])) {
                // After v1.5.1 we store image data as an array
                if (is_array($this->values[$key])) {
                    return isset($this->values[$key]['file']) ? $this->values[$key]['file'] : '';
                }

                return $this->values[$key];
            }
        }

        // otherwise, no image.
        return '';
    }
1174559
protected function findFilePath()
    {
        $filename = static::FILE_NAME;

        foreach ($this->defaultLocations() as $location) {
            if (file_exists("{$location}/$filename")) {
                return $location;
            }
        }

        return $this->defaultFilePath();
    }
1205855
private function getResource()
    {
        if ($this->mime == 'image/gif') {
            return imagecreatefromgif($this->source);
        }
        elseif ($this->mime == 'image/jpg' || $this->mime == 'image/jpeg') {
            return imagecreatefromjpeg($this->source);
        }
        elseif ($this->mime == 'image/png') {
            return imagecreatefrompng($this->source);
        }
        else
            return null;

    }
1298672
public function image() {
        $this->check_role = 'image';
        if ($this->value instanceof File) {
            $result = in_array($this->getImageType($this->value->path_tmp), [1, 2, 3, 6]);
        } else {
            $result = in_array($this->getImageType($this->value), [1, 2, 3, 6]);
        }
        $this->checkResult($result);
        return $this;
    }
825686
public function defaultImage()
    {
        // Return an empty Image object if no default value
        if (empty($this->value)) {
            return new Image;
        }

        // All src images must live in the /img (relative) directory
        if (!Str::is('/img/*', $this->value)) {
            $msg = 'Element images must be stored in public/img: '.$this->value;
            throw new Exception($msg);
        }

        // Check if the image already exists in the uploads directory
        $src = $this->value;
        $src_abs = public_path($src);
        $path = str_replace('/img/', '/elements/', $src);
        if (!app('upchuck.disk')->has($path)) {

            // Copy it to the disk
            $stream = fopen($src_abs, 'r+');
            app('upchuck.disk')->writeStream($path, $stream);
            fclose($stream);
        }

        // Wrap the touching of the element and images table in a transaction
        // so that the element isn't updated if the images write fails
        DB::beginTransaction();

        // Update or create this Element instance
        $this->value = app('upchuck')->url($path);
        $this->save();

        // Create and return new Image instance. The Image::populateFileMeta()
        // requires an UploadedFile, so we need to do it manually here.
        $size = getimagesize($src_abs);
        $image = new Image([
            'file' => $this->value,
            'name' => $this->inputName(),
            'file_type' => pathinfo($src_abs, PATHINFO_EXTENSION),
            'file_size' => filesize($src_abs),
            'width'     => $size[0],
            'height'    => $size[1],
        ]);
        $this->images()->save($image);
        DB::commit();

        // Clear cached image relations
        unset($this->relations['images']);

        // Return the image
        return $image;
    }
878870
private function getImageRetrivingClosure()
    {
        /*
         * Closure to retrieve an instnce of uploaded image with given filename
         * from request.
         *
         * @param string $filename
         * @return \Vinterskogen\UploadedImage\UploadedImage|null
         */
        return function ($filename) {
            if (! Request::hasFile($filename)) {
                return;
            }

            $uploadedFile = Request::file($filename);

            return UploadedImage::createFromBase($uploadedFile);
        };
    }
623787
private function getClosestUploadEndpoint()
    {
        if (isset($this->awsBucket)) {
            return new Promise\FulfilledPromise($this->awsBucket);
        } else {
            return $this->requestHandler->sendRequestAsync('GET', 'api/upload/endpoint')
                ->then(
                    function ($result) {
                        $this->awsBucket = $result;
                        return $result;
                    });
        }
    }
732404
private function getImageData()
    {
        ob_start();
        imagegif($this->image);
        $output = ob_get_contents();
        ob_end_clean();
        imagedestroy($this->image);

        return $output;
    }