Version
class Version (View source)
Handles regular and retina thumbnails. e.g. Each thumbnail type has two versions of itself the regular one and the 2x one.
Properties
protected string | $directoryName | The name of the directory that contains the thumbnails. |
|
protected string | $handle | The handle of the thumbnail type version. |
|
protected string | $name | The name of the thumbnail type version. |
|
protected int|null | $width | The width of the thumbnails (or the maximum width in case of proportional sizing). |
|
protected int|null | $height | The height of the thumbnails (or the maximum height in case of proportional sizing). |
|
protected bool | $isDoubledVersion | Is this a high-DPI thumbnail type version? |
|
protected string | $sizingMode | The thumbnail sizing mode (one of the \Concrete\Core\Entity\File\Image\Thumbnail\Type\Type::RESIZE_... constants). |
|
protected bool | $upscalingEnabled | Upscaling is enabled? |
|
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)? |
|
protected int[] | $associatedFileSetIDs | Associated file set IDs (whose meaning depends on the value of limitedToFileSets). |
|
protected bool | $keepAnimations | Should we create animated thumbnails for animated images? |
|
protected string | $saveAreaBackgroundColor | Background color of the Image Editor save area |
Methods
Initialize the instance.
Get a thumbnail type version given its handle.
Set the name of the directory that contains the thumbnails.
Get the name of the directory that contains the thumbnails.
Set the handle of the thumbnail type version.
Get the handle of the thumbnail type version.
Set the name of the thumbnail type version.
Get the name of the thumbnail type version.
Get the display name for this thumbnail type version (localized and escaped accordingly to $format).
Set the width of the thumbnails (or the maximum width in case of proportional sizing).
Get the width of the thumbnails (or the maximum width in case of proportional sizing).
Set the height of the thumbnails (or the maximum height in case of proportional sizing).
Get the height of the thumbnails (or the maximum height in case of proportional sizing).
Set the thumbnail sizing mode.
Get the thumbnail sizing mode.
Is upscaling enabled?
Is upscaling enabled?
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)?
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)?
Set the IDs of the associated file sets (whose meaning depends on the value of limitedToFileSets).
Get the IDs of associated file sets (whose meaning depends on the value of limitedToFileSets).
Should we create animated thumbnails for animated images?
Should we create animated thumbnails for animated images?
Background color of the Image Editor save area
Background color of the Image Editor save area
Get the display name of the thumbnail sizing mode.
Get the path to the thumbnail of a file version (relative to the to the storage location root).
Check if this thumbnail type version should exist for an image with the specified dimensions.
Details
__construct(string $directoryName, string $handle, string $name, int|null $width, int|null $height, bool $isDoubledVersion = false, string $sizingMode = ThumbnailType::RESIZE_DEFAULT, bool $limitedToFileSets = false, array $associatedFileSetIDs = [], bool $upscalingEnabled = false, bool $keepAnimations = false, string $saveAreaBackgroundColor = '')
Initialize the instance.
static Version|null
getByHandle(string $handle)
Get a thumbnail type version given its handle.
setDirectoryName(string $directoryName)
Set the name of the directory that contains the thumbnails.
string
getDirectoryName()
Get the name of the directory that contains the thumbnails.
setHandle(string $handle)
Set the handle of the thumbnail type version.
string
getHandle()
Get the handle of the thumbnail type version.
setName(string $name)
Set the name of the thumbnail type version.
string
getName()
Get the name of the thumbnail type version.
string
getDisplayName(string $format = 'html')
Get the display name for this thumbnail type version (localized and escaped accordingly to $format).
setWidth(int|null $width)
Set the width of the thumbnails (or the maximum width in case of proportional sizing).
int|null
getWidth()
Get the width of the thumbnails (or the maximum width in case of proportional sizing).
setHeight(int|null $height)
Set the height of the thumbnails (or the maximum height in case of proportional sizing).
int|null
getHeight()
Get the height of the thumbnails (or the maximum height in case of proportional sizing).
setSizingMode(string $sizingMode)
Set the thumbnail sizing mode.
string
getSizingMode()
Get the thumbnail sizing mode.
setIsUpscalingEnabled(bool $value)
Is upscaling enabled?
bool
isUpscalingEnabled()
Is upscaling enabled?
$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)?
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)?
$this
setAssociatedFileSetIDs(array $value)
Set the IDs of the associated file sets (whose meaning depends on the value of limitedToFileSets).
int[]
getAssociatedFileSetIDs()
Get the IDs of associated file sets (whose meaning depends on the value of limitedToFileSets).
setKeepAnimations(bool $value)
Should we create animated thumbnails for animated images?
bool
isKeepAnimations()
Should we create animated thumbnails for animated images?
$this
setSaveAreaBackgroundColor(string $color)
Background color of the Image Editor save area
string
getSaveAreaBackgroundColor()
Background color of the Image Editor save area
string
getSizingModeDisplayName()
Get the display name of the thumbnail sizing mode.
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.