class ThumbnailFormatService (View source)

Constants

deprecated FORMAT_PNG

deprecated FORMAT_JPEG

FORMAT_AUTO

Thumbnail format: automatic.

Properties

protected Repository $config
protected File $fileService
protected BitmapFormat $bitmapFormat

Methods

__construct(Repository $config, File $fileService, BitmapFormat $bitmapFormat)

No description

string
getFormatForFile(File|Version|string $file)

Get the format to be used for a specific file (using the configured format option).

string
getAutomaticFormatForFile(File|Version|string $file)

Get the format to be used for a specific file (calculating if from the file extension).

string
getFormatForFileExtension(string $extension)

Get the format to be used for a specific file extension (using the configured format option).

string
getAutomaticFormatForFileExtension(string $extension)

Get the format to be used for a specific file extension (calculating if from the file extension).

string
getConfiguredFormat()

Get the configured format.

Details

__construct(Repository $config, File $fileService, BitmapFormat $bitmapFormat)

No description

Parameters

Repository $config
File $fileService
BitmapFormat $bitmapFormat

string getFormatForFile(File|Version|string $file)

Get the format to be used for a specific file (using the configured format option).

Parameters

File|Version|string $file

A File of file Version instance, or a file name

Return Value

string

One of the \Concrete\Core\File\Image\BitmapFormat::FORMAT_... constants

string getAutomaticFormatForFile(File|Version|string $file)

Get the format to be used for a specific file (calculating if from the file extension).

Parameters

File|Version|string $file

A File of file Version instance, or a file name

Return Value

string

One of the \Concrete\Core\File\Image\BitmapFormat::FORMAT_... constants

string getFormatForFileExtension(string $extension)

Get the format to be used for a specific file extension (using the configured format option).

Parameters

string $extension

Return Value

string

One of the \Concrete\Core\File\Image\BitmapFormat::FORMAT_... constants

string getAutomaticFormatForFileExtension(string $extension)

Get the format to be used for a specific file extension (calculating if from the file extension).

Parameters

string $extension

the file extension (with or without a leading dot)

Return Value

string

One of the \Concrete\Core\File\Image\BitmapFormat::FORMAT_... constants

protected string getConfiguredFormat()

Get the configured format.

Return Value

string

One of the \Concrete\Core\File\Image\BitmapFormat::FORMAT_... constants, or ThumbnailFormatService::FORMAT_AUTO