Url variations.
Used as `{{ $file->url }}` or `{{ $image->getUrlAttribute('thumb') }}`.

@param  string|null $thumbSize Thumbnail size for image file.
@return string|null
963809
public function getUrlAttribute($thumbSize = null)
    {
        $path = $this->getPathAttribute($thumbSize);

        return $path ? $this->storageDisk()->url(str_replace('\\', '/', $path)) : null;
    }
1163193
public function getPath(Version $file_version, ThumbnailVersion $thumbnail)
    {
        /** @var File $file */
        $file = $file_version->getFile();
        $format = $this->formatService->getFormatForFile($file_version);
        $file_id = $file->getFileID();
        $storage_location = $file->getFileStorageLocationObject();
        $configuration = $storage_location->getConfigurationObject();
        $version_id = $file_version->getFileVersionID();
        $storage_location_id = $storage_location->getID();
        $thumbnail_handle = $thumbnail->getHandle();
        $defer = $configuration instanceof DeferredConfigurationInterface;

        // Get the path from the storage
        $path = $this->getStoredThumbnailPath(
            $file_id,
            $version_id,
            $storage_location_id,
            $thumbnail_handle,
            $format
        );

        // If we don't have a stored path already, lets determine one and store it
        if (!$path) {
            $path = $this->determineThumbnailPath($file_version, $thumbnail, $storage_location, $configuration, $format);
            if ($path) {
                $this->storeThumbnailPath($path, $file_id, $version_id, $storage_location_id, $thumbnail_handle, $format, !$defer);
            }
        }

        // Pass the path to the "getBuiltThumbnailPath" method which will alter the path if it wants to
        $realPath = $this->getBuiltThumbnailPath($path, $file_version, $thumbnail, $storage_location, $configuration, $format);

        // If the "getBuiltThumbnailPath" method didn't alter the path, lLet's let the configuration resolve the path now
        if ($path == $realPath && $defer) {
            try {
                $realPath = $this->getPathFromConfiguration($realPath, $configuration);
            } catch (\InvalidArgumentException $e) {
                // Unable to resolve the path from the configuration object, lets return the real path
            }
        }

        return $realPath;
    }
810942
public function getUrl($size)
    {
        if ($this->isProvided()) {
            return $this->locationBuilder->buildUrl($this->id, $this->cover, $size);
        } else {
            throw new RuntimeException('You gotta provide both id and cover to use this method');
        }
    }
383544
public function path(string $thumbSize = null)
    {
        return $this->attributes['type']
            .DS.$this->attributes['category']
            .($thumbSize ? DS.$thumbSize : '')
            .DS.$this->attributes['name'].'.'.$this->attributes['extension'];
    }
610906
public function getThumbUrl()
    {
        if (($sIcon = $this->oxcategories__oxthumb->value)) {
            $sSize = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sCatThumbnailsize');

            return \OxidEsales\Eshop\Core\Registry::getPictureHandler()->getPicUrl("category/thumb/", $sIcon, $sSize);
        }
    }
433248
protected function getImageSize($url)
    {
        $request = $this->http->get($url, [
            'Range' => 'bytes=0-32768'
        ]);

        if (!$request->success) {
            return false;
        }

        return getimagesizefromstring($request->data);
    }
577228
public function getBlogPostImageSrc($blogPost, $size)
    {
        $thumbsPath = $this->getBlogPostThumbsPath();
        $urlPrefix = Configure::read('app.uploadedImagesDir') . DS . 'blog_posts' . DS;

        $imageFilename = $blogPost->id_blog_post . '-' . $size . '-default.jpg';
        if (! file_exists($thumbsPath . DS . $imageFilename)) {

            $manufacturerSize = "medium";
            if($size == "single") {
                $manufacturerSize = "large";
            }

            $imageFilenameAndPath = $urlPrefix . 'no-' . $size . '-default.jpg';

            if ($blogPost->id_manufacturer != 0) {
                $imageFilenameAndPath = $this->getManufacturerImageSrc($blogPost->id_manufacturer, $manufacturerSize);
            }
        } else {
            $imageFilenameAndPath = $urlPrefix . $imageFilename;
        }

        return $this->prepareAsUrl($imageFilenameAndPath);
    }
1071428
public static function thumbit($thumb)
	{
		$dot = strrpos($thumb, '.') + 1;
		$ext = substr($thumb, $dot);

		return preg_replace('#\.[^.]*$#', '', $thumb) . '_thumb.' . $ext;
	}
923115
public function get_thumb( $object ) {
		$thumbnail = '';

		if ( $this->field->options( 'show_thumbnails' ) ) {
			// Set thumbnail if the options is true
			$thumbnail = $this->field->options( 'query_users' )
				? get_avatar( $object->ID, 25 )
				: get_the_post_thumbnail( $object->ID, array( 50, 50 ) );
		}

		return $thumbnail;
	}
490243
public function get_thumbnail()
    {
        $video_thumbnails = $this->entry->getVideoThumbnails();

        foreach ($video_thumbnails as $thumb) {
            if (120 == $thumb['width'] && 90 == $thumb['height']) {
                return $thumb['url'];
            }
        }
    }
497940
public function get_thumbnail($key = 0)
	{
		$thumbnails = $this->get_thumbnails();
		if (isset($thumbnails[$key]))
		{
			return $thumbnails[$key];
		}

		return null;
	}
925438
public function ThumbnailURL($width, $height)
    {
        $thumbnail = $this->Thumbnail($width, $height);
        if ($thumbnail) {
            return $thumbnail->getURL();
        }
        return $this->getIcon();
    }
743556
public function thumbnail($size = null, $attr = null)
    {
        return get_the_post_thumbnail($this->id(), $size, $attr);
    }
943011
function saveThumbnail($ThumbFile)
    {
        $ThumbFile = trim($ThumbFile);
        $file = basename($this->file);

        if (empty($ThumbFile))
        {
            $ThumbFile = "th_$file";
        }

        if (!empty($this->ImageInfo["h"]["Thumbnail"]))
        {
            $tp = fopen($ThumbFile, "wb");
            if (!$tp)
            {
                $this->errno = 2;
                $this->errstr = "Cannot Open file '$ThumbFile'";
            }
            fwrite($tp, $this->ImageInfo["h"]["Thumbnail"]);
            fclose($tp);
            touch($ThumbFile, filemtime($this->file));
        }
        //$this->thumbnailURL = $ThumbFile;
        $this->ImageInfo["h"]["Thumbnail"] = $ThumbFile;
    }
562809
private function resolveResourceThumbnail($defaultImage)
    {
        $baseFolder = $this->getBaseFolder();
        $iconUrl = $baseFolder.DIRECTORY_SEPARATOR.'default_thumbnail.png';
        foreach ($this->getThumbnailBaseFolderPaths() as $path) {
            $imageFilePath = $path.DIRECTORY_SEPARATOR.$defaultImage;

            if (file_exists($imageFilePath) && is_readable($imageFilePath)) {
                $iconUrl = $baseFolder.DIRECTORY_SEPARATOR.$defaultImage;
                break;
            }
        }

        return $iconUrl;
    }
89343
public function thumbnail($size = null)
    {
        $size = ($size) ? $size : $this->config->get('images.size');

        if ($id = $this->thumbnailId) {
            return new Image($id, $size);
        }
    }
54579
public static function get_thumbnail_size() {
		$sizes = self::get_image_sizes();

		if ( isset( $sizes['thumbnail'] ) ) {
			return $sizes['thumbnail'];
		}

		$img_size = reset( $sizes );

		return $img_size;
	}