Get image path.

@param string $path

@return string
500268
private function getImagePath($path)
    {
        if ($path && file_exists($this->filesystem->getRootDir() . $path)) {
            return $path;
        }

        return $this->noImagePath;
    }
1364794
public static function getTransformPathForPath($path): string
    {
        /** @var ConfigModel $settings */
        $config = ImagerService::getConfig();

        $hashPath = $config->hashPath;
        $pathParts = pathinfo($path);

        if ($hashPath) {
            return FileHelper::normalizePath('/' . md5($pathParts['dirname']));
        }

        return FileHelper::normalizePath($pathParts['dirname']);
    }
250816
public function getUrl($path)
    {
        $path = $this->applyPathPrefix($path);

        return implode('/', [$this->baseUrl, $path]);
    }
602291
public static function getRealPath($path)
    {
        $path = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $path);

        return rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
    }
621697
protected function get_pathfor($path = '') {
        $path = trim($path, '/') !== '' ? '/' . trim($path, '/') : '';
        return $this->connectionpoint->get_path() . '/' .
               'subplugin_' . $this->subplugintype . '_' .
               $this->subpluginname . '_' . basename($this->connectionpoint->get_path()) . $path;
    }
1191781
public static function getNameFromPath($path)
    {
        $path = rtrim($path, '/'); // may be a folder
        if (empty($path)) {
            return '.';
        } // self directory

        $marker = strrpos($path, '/');
        if (false === $marker) {
            return $path;
        }

        return substr($path, $marker + 1);
    }
1165500
protected function getPath($path)
	{
		$rootPath = $this->option('path');

		return $rootPath.'/'.strtolower($this->getTheme()).'/' . $path;
	}
636745
protected function get_thumbnail_path($path) {
        $relative_path = $this->getRelativePath($path);
        $thumbnail_path = $this->path_to_files . '/' . $this->config['images']['thumbnail']['dir'] . '/';

        if (is_dir($path)) {
            $thumbnail_fullpath = $thumbnail_path . $relative_path . '/';
        } else {
            $thumbnail_fullpath = $thumbnail_path . dirname($relative_path) . '/' . basename($path);
        }

        return $this->cleanPath($thumbnail_fullpath);
    }
1185155
static public function uploadUrl($path)
    {
        if (strpos($path, 'images') === 0) {
            return Config::getRootUrl($path);
        }
        
        return Config::getUploadFileUrl($path);
    }
1329099
public function image($path)
    {
        if (gplcart_path_is_absolute($path)) {
            $file = $path;
            $url = gplcart_path_relative($path);
        } else {

            $path = gplcart_path_normalize($path);
            $prefix = gplcart_path_relative(GC_DIR_FILE);

            if (strpos($path, "$prefix/") === 0) {
                $url = $path;
                $file = gplcart_file_absolute($path);
            } else {
                $url = "$prefix/$path";
                $file = gplcart_path_absolute($path);
            }
        }

        $query = is_file($file) ? array('v' => filemtime($file)) : array();

        return $this->get($url, $query, false, true);
    }
48939
public function Path($Path = NULL) {
      if (is_string($Path)) {
         $Result = $this->_ParsedRequestElement('Path', $Path);
      } else {
         $Result = $this->_ParsedRequestElement('Path');
         if ($Path === TRUE) {
            // Encode the path.
            $Parts = explode('/', $Result);
            $Parts = array_map('urlencode', $Parts);
            $Result = implode('/', $Parts);
         }
      }
      
      return $Result;
   }
397584
protected function get_imageinfo_from_path($path) {
        $imageinfo = getimagesize($path);

        $image = array(
                'width'     => $imageinfo[0],
                'height'    => $imageinfo[1],
                'mimetype'  => image_type_to_mime_type($imageinfo[2]),
            );
        if (empty($image['width']) or empty($image['height']) or empty($image['mimetype'])) {
            // GD can not parse it, sorry.
            return false;
        }
        return $image;
    }
1153038
public function getUrl($path)
    {
        $path = ltrim($path, "/");
        $url = '';
        if ($this->isFile($path)) $url = $this->host.$path;

        return $url;
    }
1338774
public function getAssetPath(string $path)
    {
        if (!$this->urlHelper->isFullUrl($path)) {
            $path = $this->pathHelper->prefix($path);
        }

        return $this->urlHelper->getUrl(self::BASE_URL.$path);
    }
792463
public static function from($path)
    {
        switch( self::getFileExtension($path) )
        {
            case 'png' : return imagecreatefrompng($path);
            case 'gif' : return imagecreatefromgif($path);
            case 'jpg' :
            case 'jpeg':
            default    : return imagecreatefromjpeg($path);
        }
    }
353315
protected static function getRelativePath($path)
	{
		preg_match('/([[:alpha:]]*):\/\/(.*)/', $path, $name);

		if (isset($name[2]) && $name[2])
		{
			return $name[2];
		}

		return $path;
	}
921954
public static function parseQueryPath($path)
    {
        $path = '/' . ltrim($path, '/');
        $path = preg_replace('/[\x00-\x1F\x7F]/', '', $path);

        //examples:
        //1.> /images/../foo.png
        //2.> /foo.png

        //1.> /images/../../foo.png
        //2.> /foo.png
        //3.> false
        while (false !== $pos = strpos($path, '/../')) {
            $leftSlashNext = strrpos(substr($path, 0, $pos), '/');

            if (false === $leftSlashNext) {
                // one /../ too much, without space to the left/up
                return false;
            }

            $path = substr($path, 0, $leftSlashNext + 1) . substr($path, $pos + 4);
        }

        return $path;
    }