CustomThumbnail
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
CustomThumbnail constructor.
Get a thumbnail type version given its handle.
Set the name of the directory that contains the thumbnails.
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).
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?
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.
No description
Details
__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.
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?
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.
isCropped()
No description