ThumbnailerInterface
interface ThumbnailerInterface (View source)
Interface ThumbnailerInterface An interface for classes tasked with creating thumbnails. This interace requires imagine.
Methods
Get the storage location to use.
Set the storage location to use. Note that the $savePath is going to be relative to this location.
Overrides the default JPEG compression level per instance of the image helper.
Get the currently set JPEG compression level.
Overrides the default PNG compression level per instance of the image helper.
Get the currently set PNG compression level.
Set the format of the generated thumbnails.
Get the format of the generated thumbnails.
Create a thumbnail given an image (or a path to an image).
Returns a path to the specified item, resized and/or cropped to meet max width and height. $obj can e Returns an object with the following properties: src, width, height.
Details
StorageLocationInterface
getStorageLocation()
Get the storage location to use.
ThumbnailerInterface
setStorageLocation(StorageLocationInterface $storageLocation)
Set the storage location to use. Note that the $savePath is going to be relative to this location.
ThumbnailerInterface
setJpegCompression(int $level)
Overrides the default JPEG compression level per instance of the image helper.
This allows for a single-use for a particularly low or high compression value.
int
getJpegCompression()
Get the currently set JPEG compression level.
ThumbnailerInterface
setPngCompression(int $level)
Overrides the default PNG compression level per instance of the image helper.
This allows for a single-use for a particularly low or high compression value.
int
getPngCompression()
Get the currently set PNG compression level.
ThumbnailerInterface
setThumbnailsFormat(string $thumbnailsFormat)
Set the format of the generated thumbnails.
string
getThumbnailsFormat()
Get the format of the generated thumbnails.
create(ImagineInterface|string $image, string $savePath, int|null $width, int|null $height, bool $fit = false)
Create a thumbnail given an image (or a path to an image).
stdClass
getThumbnail(File|string $obj, int|null $maxWidth, int|null $maxHeight, bool $crop = false)
Returns a path to the specified item, resized and/or cropped to meet max width and height. $obj can e Returns an object with the following properties: src, width, height.