Get original path to file.

@param  string|null $thumbSize
@return string
489808
protected function originalPath(File $file, string $thumbSize = null)
    {
        return $file->getOriginal('type')
            .DS.$file->getOriginal('category')
            .($thumbSize ? DS.$thumbSize : '')
            .DS.$file->getOriginal('name').'.'.$file->getOriginal('extension');
    }
118168
public static function getImageSize( string $size = 'thumbnail') {
		$sizes = self::getImageSizes();
		$size  = key_exists( $size, $sizes ) ? $size : 'thumbnail';

		return $sizes[ $size ];
	}
392064
protected function getPath(/*# string */ $key)/*# : string */
    {
        // get directory first
        if (($pos = strrpos($key, '/')) !== false) {
            $dir  = $this->dir_root . DIRECTORY_SEPARATOR .
                    substr($key, 0, $pos) . DIRECTORY_SEPARATOR;
            $key  = substr($key, $pos + 1);
        } else {
            $dir  = $this->dir_root . DIRECTORY_SEPARATOR;
        }

        // get file path
        if (is_callable($this->path_func)) {
            $func = $this->path_func;
            $file = $func($key);

        // hashed version
        } else {
            $file = $key ? $this->hashIt($key) : '';
        }

        return $dir . $file;
    }
891448
private function _getFilePath($pKey)
    {
        $keyArr   = explode(static::SECTION_DELIMITER, $pKey, 2);
        $fileName = $keyArr[0];

        if (! isset($this->_paths[$fileName])) {
            $encodedFileName         = md5($fileName);
            $this->_paths[$fileName] = $this->_dir
                                     . FileData::getSubPath($encodedFileName, self::SUB_DIRS)
                                     . $encodedFileName
                                     . self::AGL_VAR_CACHE_EXT;
        }

        $this->_paths[$pKey] = $this->_paths[$fileName];

        return $this->_paths[$fileName];
    }
1008553
public function getFile($key)
    {
        $key = str_replace($this->illegalChars, '_', $this->namespace . $key);
        return $this->dir . '/' . $key . '.' . $this->ext;
    }
40720
public function thumbnailURL($size = 'large')
    {
        if (!in_array($size, ['large', 'medium', 'small'])) {
            return false;
        }

        $info = $this->parseLink();
        $service = $this->getService();

        if (!$info || !$service) {
            return false;
        }

        if ($service == 'YouTube') {
            if ($size == 'large') {
                $img = 'hqdefault.jpg';
            } elseif ($size == 'medium') {
                $img = 'mqdefault.jpg';
            } else {
                $img = 'default.jpg';
            }
            return 'https://i.ytimg.com/vi/' . $this->VideoID . '/' . $img;
        }

        if ($service == 'Vimeo') {
            $data = $this->getCachedJsonResponse(
                'https://vimeo.com/api/v2/video/' . $this->VideoID . '.json'
            );

            if (!$data) {
                return false;
            }

            if ($size == 'large' && (!empty($data[0]['thumbnail_large']))) {
                return $data[0]['thumbnail_large'];
            } elseif ($size == 'medium' && (!empty($data[0]['thumbnail_medium']))) {
                return $data[0]['thumbnail_medium'];
            } elseif (!empty($data[0]['thumbnail_small'])) {
                return $data[0]['thumbnail_small'];
            }
        }

        return false;
    }
1073997
public function getThumbUrl($size = 'thumb')
    {
        $url = $this->package->config('icons.url');
        $icons = $this->package->config('icons.files');

        if (!$this->metadata->isFile()) {
            return $url . $icons['dir'];
        }

        if ($this->isImage()) {
            $thumbs = $this->getThumbsDetails();

            if (!array_key_exists($size, $thumbs)) {
                return $url . $icons['img'];
            }

            return $thumbs[$size]['url'];
        }

        $mime = $this->getMime();
        if (!array_key_exists($mime, $icons)) {
            $message = sprintf('Configuration file is missing for `%s` file type in `icons.files` array', $mime);
            throw new \Exception($message);
        }

        return $url . $icons[$mime];
    }
459660
def get_thumbnail(file_, name):
    
    options = settings.OPTIONS_DICT[name]
    opt = copy(options)
    geometry = opt.pop('geometry')

    return original_get_thumbnail(file_, geometry, **opt)
1217429
function GetThumb($dir, $md5, $filename, $mode, $width = 100, $height = 100)
    {
        $path = realpath(DIR_ROOT . '/' . $dir);
        if (is_file($path . '/.thumbs/' . $md5 . '_' . $width . '_' . $height . '_' . $mode . '.jpg'))
        {
            return $dir . '/.thumbs/' . $md5 . '_' . $width . '_' . $height . '_' . $mode . '.jpg';
        }

        $t = new Image_Toolbox($path . '/' . $filename);
        $t->newOutputSize($width, $height, $mode, false, '#FFFFFF');
        $filename = '/.thumbs/' . $md5 . '_' . $width . '_' . $height . '_' . $mode . '.jpg';
        $t->save($path . $filename, 'jpg', 80);
        chmod($path . $filename, 0666);
        return $dir . $filename;
    }
389247
public function thumbUrl( string $size = 'thumbnail') {
		$size = WP::getImageSize( $size );
		
		return get_avatar_url( $this->ID, ['size' => $size['width'] ] );
	}
1141534
protected function getThumbFilename($original, $extension, $alias, $width, $height)
	{
		/** @var Module $module */
		$module = Module::getInstance();

		return strtr($module->thumbFilenameTemplate, [
			'{width}'     => $width,
			'{height}'    => $height,
			'{alias}'     => $alias,
			'{original}'  => $original,
			'{extension}' => $extension,
		]);
	}
456873
private function getFilePath($key)
    {
        if (!preg_match('|^[a-zA-Z0-9_\.! ]+$|', $key)) {
            throw new InvalidArgumentException(sprintf('Invalid key "%s". Valid filenames must match [a-zA-Z0-9_\.! ].', $key));
        }

        return sprintf('%s/%s', $this->folder, $key);
    }
913777
public function getGitHookExecutionPath(): string
    {
        $gitPath = $this->getGitDir();

        return $this->fileSystem->makePathRelative($this->getWorkingDir(), $this->getAbsolutePath($gitPath));
    }
1071428
public static function thumbit($thumb)
	{
		$dot = strrpos($thumb, '.') + 1;
		$ext = substr($thumb, $dot);

		return preg_replace('#\.[^.]*$#', '', $thumb) . '_thumb.' . $ext;
	}
953750
public function getThumbPath()
    {
        return (!empty($this->thumb_path) ? str_replace($this->getThumbRootDir(), '', DirectoryHelper::slashDirname($this->thumb_path)) : '');
    }
1045036
public function getRealFileSize($fileSize)
    {
        //B goes at the end because it's always matched otherwise
        $validUnits = ['KB', 'MB', 'GB', 'TB'];
        $value = str_replace(' ', '', $fileSize);

        $pattern = '/\d+/';
        preg_match($pattern, $value, $match);

        foreach ($validUnits as $unit) {
            if (strpos($fileSize, $unit)) {
                switch ($unit) {
                    case 'B':
                        return $match[0] * pow(1024, 0);
                    case 'KB':
                        return $match[0] * pow(1024, 1);
                    case 'MB':
                        return $match[0] * pow(1024, 2);
                    case 'GB':
                        return $match[0] * pow(1024, 3);
                    case 'TB':
                        return $match[0] * pow(1024, 4);
                }
            }
        }

        return $fileSize;
    }
409601
public function getFilePath() : ?string 
    {
        if ( ! $this->hasFilePath()) {
            $this->setFilePath($this->getDefaultFilePath());
        }
        return $this->filePath;
    }