Get the thumbnail relative URI, using an alias.

@param string|null $fileName
@param string      $alias

@return string
506132
private function getAliasedUri($fileName, $alias)
    {
        if ($fileName === null) {
            return false;
        }

        if (!$this->isAlias($alias)) {
            return false;
        }

        // If we're passing in an image as array, instead of a single filename.
        $fileName = $this->normalizeFileName($fileName);

        return $this->urlGenerator->generate(
            'thumb_alias',
            [
                'alias'  => $alias,
                'file'   => $fileName,
            ]
        );
    }
75067
public function getFilePath($fileName = null)
    {
        if ($fileName === null) {
            $fileName = $this->fileName;
        }

        return $this->theme->getPath().'/'.$this->getObjectTypeDirName().'/'.$fileName;
    }
425885
public static function getAlias(string $alias): string
    {
        // empty OR not an alias
        if (!$alias || $alias[0] !== '@') {
            return $alias;
        }

        if (isset(self::$aliases[$alias])) {
            return self::$aliases[$alias];
        }

        list($root) = \explode('/', $alias, 2);
        if (!isset(self::$aliases[$root])) {
            throw new \InvalidArgumentException('The set root alias does not exist，alias=' . $root);
        }

        $rootPath  = self::$aliases[$root];
        $aliasPath = \str_replace($root, '', $alias);

        return $rootPath . $aliasPath;
    }
824531
public function downloadExistsFile($fileName, $aliasOfFileName = '')
    {
        $baseFileName = $aliasOfFileName === '' ? basename($fileName) : $aliasOfFileName;

        header("Content-Type: text/csv; charset={$this->getHeaderCharset()}");
        header("Content-Disposition: attachment; filename={$baseFileName}");

        readfile($fileName);
    }
582461
function imageAlias( $aliasName )
    {
        $imageManager = eZImageManager::factory();
        if ( !$imageManager->hasAlias( $aliasName ) )
        {
            return null;
        }

        $aliasList = $this->aliasList();
        if ( array_key_exists( $aliasName, $aliasList ) )
        {
            return $aliasList[$aliasName];
        }
        else
        {
            $original = $aliasList['original'];
            $basename = $original['basename'];
            if ( $imageManager->createImageAlias( $aliasName, $aliasList,
                                                  array( 'basename' => $basename ) ) )
            {
                $text = $this->displayText( $original['alternative_text'] );
                $originalFilename = $original['original_filename'];
                foreach ( $aliasList as $aliasKey => $alias )
                {
                    $alias['original_filename'] = $originalFilename;
                    $alias['text'] = $text;
                    if ( $alias['url'] )
                    {
                        $aliasFile = eZClusterFileHandler::instance( $alias['url'] );
                        if( $aliasFile->exists() )
                            $alias['filesize'] = $aliasFile->size();
                    }
                    if ( $alias['is_new'] )
                    {
                        eZImageFile::appendFilepath( $this->ContentObjectAttributeData['id'], $alias['url'] );
                    }
                    $aliasList[$aliasKey] = $alias;
                }
                $this->setAliasList( $aliasList );
                $this->addImageAliases( $aliasList );
                $aliasList = $this->aliasList();
                return $aliasList[$aliasName];
            }
        }

        return null;
    }
963809
public function getUrlAttribute($thumbSize = null)
    {
        $path = $this->getPathAttribute($thumbSize);

        return $path ? $this->storageDisk()->url(str_replace('\\', '/', $path)) : null;
    }
111345
public function getUrl(MediaInterface $media, $alias = null)
    {
        return $this->filesystemManipulator->url($this->getAliasAndKey($media, $alias));
    }
17178
public function getBlockURL($filename = null)
    {
        $obj = $this->blockType;
        if ($obj->getPackageID() > 0) {
            if (is_dir(DIR_PACKAGES_CORE . '/' . $obj->getPackageHandle())) {
                $base = ASSETS_URL . '/' . DIRNAME_PACKAGES . '/' . $obj->getPackageHandle(
                    ) . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
            } else {
                $base = DIR_REL . '/' . DIRNAME_PACKAGES . '/' . $obj->getPackageHandle(
                    ) . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
            }
        } else {
            if (file_exists(DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . $filename)) {
                $base = REL_DIR_APPLICATION . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
            } else {
                $base = ASSETS_URL . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
            }
        }

        return $base;
    }
1163416
private function  &getImageSource($filename) {

        $image = NULL;
        $extesion = self::getFileExt($filename);
        switch ( $extesion ) {

            case 'gif':
                $image = imagecreatefromgif($filename);
                break;

            case 'png':
                $image = imagecreatefrompng($filename);
                break;

            case 'jpg':
            case 'jpeg':
                $image = imagecreatefromjpeg($filename);
                break;

        }
        return $image;
    }
309550
function getAlias( $alias ) {

        return isset( $this->aliases[ $alias ] ) ? $this->aliases[ $alias ] : $alias;

    }
525734
public function embeddedImage($filename)
    {
        if (is_file($filename) && preg_match('/[.](?P<extension>[a-zA-Z0-9]+)$/', $filename, $matches)) {
            return sprintf('data:image/%s;base64,%s', $matches['extension'], base64_encode(file_get_contents($filename)));
        }

        return null;
    }
1191183
def filename_to_uri(self, filename):
        """"""

        try:
            return self._uri_cache[filename]
        except KeyError:
            value = self._relativeize(filename)
            self._uri_cache[filename] = value
            return value
465118
protected function getFullFileName($containerName, $fileName, $relativePath)
    {
        if ($relativePath === null) {
            $relativePath = '';
        } else {
            $relativePath = trim($relativePath, '/');
            $relativePath = $relativePath . '/';
        }

        return sprintf('%s/%s%s', $containerName, $relativePath, $fileName);
    }
342433
protected function getFileName (string $fileName)
    {
        if (!$fileName && filter_var ($fileName, FILTER_VALIDATE_URL) === false) {
            return null;
        }

        $explodeFileURL = explode ('/', $fileName);
        $fileName       = end ($explodeFileURL);

        return sanitizeString (pathinfo ($fileName, PATHINFO_FILENAME)) . '.' . pathinfo ($fileName, PATHINFO_EXTENSION);
    }
491385
public function getUrl(string $filename): GetUrlCommand
    {
        /** @var GetUrlCommand $command */
        $command = $this->builder->build(GetUrlCommand::class);
        $command->byFilename($filename);

        return $command;
    }
250248
public function download($filename, $alias = null)
    {
        $fileDowloader = new FileDownloader($this->headerBag);
        $fileDowloader->download($filename, $alias);

        // Terminate the script with success
        exit(1);
    }
725168
public function alias($alias, $path = null)
	{
		if (is_null($path))
		{
			return $this->aliases[$alias] ?: null;
		}
		else
		{
			$this->aliases[$alias] = $path;
		}
	}