class CustomThumbnail extends Version (View source)

Properties

protected string $directoryName

The name of the directory that contains the thumbnails.

from  Version
protected string $handle

The handle of the thumbnail type version.

from  Version
protected string $name

The name of the thumbnail type version.

from  Version
protected int|null $width

The width of the thumbnails (or the maximum width in case of proportional sizing).

from  Version
protected int|null $height

The height of the thumbnails (or the maximum height in case of proportional sizing).

from  Version
protected bool $isDoubledVersion

Is this a high-DPI thumbnail type version?

from  Version
protected string $sizingMode

The thumbnail sizing mode (one of the \Concrete\Core\Entity\File\Image\Thumbnail\Type\Type::RESIZE_... constants).

from  Version
protected bool $upscalingEnabled

Upscaling is enabled?

from  Version
protected bool $limitedToFileSets

Should the thumbnails be build for every file that ARE NOT in the file sets (false), or only for files that ARE in the specified file sets (true)?

from  Version
protected int[] $associatedFileSetIDs

Associated file set IDs (whose meaning depends on the value of limitedToFileSets).

from  Version
protected bool $keepAnimations

Should we create animated thumbnails for animated images?

from  Version
protected $path
protected $cropped

Methods

__construct(int|null $width, int|null $height, string $path, bool $cropped)

CustomThumbnail constructor.

static Version|null
getByHandle(string $handle)

Get a thumbnail type version given its handle.

from  Version
setDirectoryName(string $directoryName)

Set the name of the directory that contains the thumbnails.

from  Version
string
getDirectoryName()

Get the name of the directory that contains the thumbnails.

from  Version
setHandle(string $handle)

Set the handle of the thumbnail type version.

from  Version
string
getHandle()

Get the handle of the thumbnail type version.

from  Version
setName(string $name)

Set the name of the thumbnail type version.

from  Version
string
getName()

Get the name of the thumbnail type version.

from  Version
string
getDisplayName(string $format = 'html')

Get the display name for this thumbnail type version (localized and escaped accordingly to $format).

from  Version
setWidth(int|null $width)

Set the width of the thumbnails (or the maximum width in case of proportional sizing).

from  Version
int|null
getWidth()

Get the width of the thumbnails (or the maximum width in case of proportional sizing).

from  Version
setHeight(int|null $height)

Set the height of the thumbnails (or the maximum height in case of proportional sizing).

from  Version
int|null
getHeight()

Get the height of the thumbnails (or the maximum height in case of proportional sizing).

from  Version
setSizingMode(string $sizingMode)

Set the thumbnail sizing mode.

from  Version
string
getSizingMode()

Get the thumbnail sizing mode.

from  Version
setIsUpscalingEnabled(bool $value)

Is upscaling enabled?

from  Version
bool
isUpscalingEnabled()

Is upscaling enabled?

from  Version
$this
setLimitedToFileSets(bool $value)

Should the thumbnails be build for every file that ARE NOT in the file sets (false), or only for files that ARE in the specified file sets (true)?

from  Version
bool
isLimitedToFileSets()

Should the thumbnails be build for every file that ARE NOT in the file sets (false), or only for files that ARE in the specified file sets (true)?

from  Version
$this
setAssociatedFileSetIDs(array $value)

Set the IDs of the associated file sets (whose meaning depends on the value of limitedToFileSets).

from  Version
int[]
getAssociatedFileSetIDs()

Get the IDs of associated file sets (whose meaning depends on the value of limitedToFileSets).

from  Version
setKeepAnimations(bool $value)

Should we create animated thumbnails for animated images?

from  Version
bool
isKeepAnimations()

Should we create animated thumbnails for animated images?

from  Version
string
getSizingModeDisplayName()

Get the display name of the thumbnail sizing mode.

from  Version
string
getFilePath(Version $fv)

Get the path to the thumbnail of a file version (relative to the to the storage location root).

bool
shouldExistFor(int $imageWidth, int $imageHeight, File $file = null)

Check if this thumbnail type version should exist for an image with the specified dimensions.

from  Version
isCropped()

No description

Details

__construct(int|null $width, int|null $height, string $path, bool $cropped)

CustomThumbnail constructor.

Parameters

int|null $width

the width of the thumbnails (or the maximum width in case of proportional sizing)

int|null $height

the height of the thumbnails (or the maximum height in case of proportional sizing)

string $path

The full path to the file (whether it exists or not)

bool $cropped

static Version|null getByHandle(string $handle)

Get a thumbnail type version given its handle.

Parameters

string $handle

Return Value

Version|null

setDirectoryName(string $directoryName)

Set the name of the directory that contains the thumbnails.

Parameters

string $directoryName

string getDirectoryName()

Get the name of the directory that contains the thumbnails.

Return Value

string

setHandle(string $handle)

Set the handle of the thumbnail type version.

Parameters

string $handle

string getHandle()

Get the handle of the thumbnail type version.

Return Value

string

setName(string $name)

Set the name of the thumbnail type version.

Parameters

string $name

string getName()

Get the name of the thumbnail type version.

Return Value

string

string getDisplayName(string $format = 'html')

Get the display name for this thumbnail type version (localized and escaped accordingly to $format).

Parameters

string $format

= 'html' Escape the result in html format (if $format is 'html'). If $format is 'text' or any other value, the display name won't be escaped.

Return Value

string

setWidth(int|null $width)

Set the width of the thumbnails (or the maximum width in case of proportional sizing).

Parameters

int|null $width

int|null getWidth()

Get the width of the thumbnails (or the maximum width in case of proportional sizing).

Return Value

int|null

setHeight(int|null $height)

Set the height of the thumbnails (or the maximum height in case of proportional sizing).

Parameters

int|null $height

int|null getHeight()

Get the height of the thumbnails (or the maximum height in case of proportional sizing).

Return Value

int|null

setSizingMode(string $sizingMode)

Set the thumbnail sizing mode.

Parameters

string $sizingMode

One of the \Concrete\Core\Entity\File\Image\Thumbnail\Type\Type::RESIZE_... constants

string getSizingMode()

Get the thumbnail sizing mode.

Return Value

string

One of the \Concrete\Core\Entity\File\Image\Thumbnail\Type\Type::RESIZE_... constants

setIsUpscalingEnabled(bool $value)

Is upscaling enabled?

Parameters

bool $value

bool isUpscalingEnabled()

Is upscaling enabled?

Return Value

bool

$this setLimitedToFileSets(bool $value)

Should the thumbnails be build for every file that ARE NOT in the file sets (false), or only for files that ARE in the specified file sets (true)?

Parameters

bool $value

Return Value

$this

bool isLimitedToFileSets()

Should the thumbnails be build for every file that ARE NOT in the file sets (false), or only for files that ARE in the specified file sets (true)?

Return Value

bool

$this setAssociatedFileSetIDs(array $value)

Set the IDs of the associated file sets (whose meaning depends on the value of limitedToFileSets).

Parameters

array $value

Return Value

$this

int[] getAssociatedFileSetIDs()

Get the IDs of associated file sets (whose meaning depends on the value of limitedToFileSets).

Return Value

int[]

setKeepAnimations(bool $value)

Should we create animated thumbnails for animated images?

Parameters

bool $value

bool isKeepAnimations()

Should we create animated thumbnails for animated images?

Return Value

bool

string getSizingModeDisplayName()

Get the display name of the thumbnail sizing mode.

Return Value

string

string getFilePath(Version $fv)

Get the path to the thumbnail of a file version (relative to the to the storage location root).

Parameters

Version $fv

the file version for which you want the path of the associated thumbnail

Return Value

string

bool shouldExistFor(int $imageWidth, int $imageHeight, File $file = null)

Check if this thumbnail type version should exist for an image with the specified dimensions.

Parameters

int $imageWidth

The original image width

int $imageHeight

The original image height

File $file

The File instance to check file sets against

Return Value

bool

isCropped()

No description