Thumbnail
class Thumbnail implements ImageInterface (View source)
A system-generated preview version of an Asset
Traits
Trait for methods regarding the dimensions of an asset
Trait for methods regarding the quality of an asset
Properties
protected int | $width | from DimensionsTrait | |
protected int | $height | from DimensionsTrait | |
protected int | $quality | from QualityTrait | |
protected ThumbnailGeneratorStrategy | $generatorStrategy | ||
protected ThumbnailService | $thumbnailService | ||
protected Asset | $originalAsset | ||
protected PersistentResource | $resource | ||
protected string | $staticResource | ||
protected string[] | $configuration | ||
protected string | $configurationHash | ||
protected bool | $async |
Methods
Edge / aspect ratio of the image
Orientation of this image, i.e. portrait, landscape or square
Whether this image is square aspect ratio and therefore has a square orientation
Constructs a new Thumbnail
Initializes this thumbnail
Post persistence lifecycle callback
Returns the Asset this thumbnail is derived from
No description
PersistentResource of this thumbnail
No description
No description
No description
No description
No description
No description
Refreshes this asset after the PersistentResource has been modified
Details
int
getWidth()
Width of the image in pixels
int
getHeight()
Height of the image in pixels
bool
hasDimensions()
Does the asset have dimensions
float
getAspectRatio(bool $respectOrientation = false)
Edge / aspect ratio of the image
string
getOrientation()
Orientation of this image, i.e. portrait, landscape or square
bool
isOrientationSquare()
Whether this image is square aspect ratio and therefore has a square orientation
bool
isOrientationLandscape()
Whether this image is in landscape orientation
bool
isOrientationPortrait()
Whether this image is in portrait orientation
int
getQuality()
Returns the quality of the image
__construct(AssetInterface $originalAsset, ThumbnailConfiguration $configuration)
Constructs a new Thumbnail
void
initializeObject(int $initializationCause)
Initializes this thumbnail
onPostPersist()
Post persistence lifecycle callback
ImageInterface
getOriginalAsset()
Returns the Asset this thumbnail is derived from
protected void
setConfiguration(ThumbnailConfiguration $configuration)
No description
mixed
getConfigurationValue(string $value)
No description
PersistentResource
getResource()
PersistentResource of this thumbnail
void
setResource(PersistentResource $resource)
No description
string
getStaticResource()
No description
void
setStaticResource(string $staticResource)
No description
void
setWidth(int $width)
No description
void
setHeight(int $height)
No description
void
setQuality(int $quality)
No description
void
refresh()
Refreshes this asset after the PersistentResource has been modified