interface ThumbnailSupportInterface (View source)

Interface for models which provide methods for thumbnails

Methods

getThumbnail(int $maximumWidth = null, int $maximumHeight = null, string $ratioMode = ImageInterface::RATIOMODE_INSET, bool $allowUpScaling = null)

Returns a thumbnail of this model

mixed
addThumbnail(Thumbnail $thumbnail)

Adds a thumbnail which was generated by the ThumbnailService.

Details

Thumbnail getThumbnail(int $maximumWidth = null, int $maximumHeight = null, string $ratioMode = ImageInterface::RATIOMODE_INSET, bool $allowUpScaling = null)

Returns a thumbnail of this model

If the maximum width / height is not specified or exceeds the original asset's dimensions, the width / height of the original asset is used.

Parameters

int $maximumWidth

The thumbnail's maximum width in pixels

int $maximumHeight

The thumbnail's maximum height in pixels

string $ratioMode

Whether the resulting image should be cropped if both edge's sizes are supplied that would hurt the aspect ratio

bool $allowUpScaling

Whether the resulting image should be upscaled

Return Value

Thumbnail

mixed addThumbnail(Thumbnail $thumbnail)

Adds a thumbnail which was generated by the ThumbnailService.

Parameters

Thumbnail $thumbnail

Return Value

mixed

See also

getThumbnail()