Image_Backend
interface Image_Backend (View source)
Image_Backend
A backend for manipulation of images via the Image class
Constants
ORIENTATION_SQUARE |
Represents a square orientation |
ORIENTATION_PORTRAIT |
Represents a portrait orientation |
ORIENTATION_LANDSCAPE |
Represents a landscape orientation |
Methods
No description
No description
Populate the backend from a local path
Get the currently assigned image resource
Set the currently assigned image resource
Write to the given asset store
Write the backend to a local path
Set the quality to a value between 0 and 100
Resize an image, skewing it as necessary.
Resize the image by preserving aspect ratio. By default, it will keep the image inside the maxWidth and maxHeight. Passing useAsMinimum will make the smaller dimension equal to the maximum corresponding dimension
Resize an image by width. Preserves aspect ratio.
Resize an image by height. Preserves aspect ratio.
Return a clone of this image resized, with space filled in with the given colour
Resize an image to cover the given width/height completely, and crop off any overhanging edges.
Crop's part of image.
Details
__construct(AssetContainer $assetContainer = null)
Create a new backend with the given object
int
getWidth()
int
getHeight()
loadFromContainer(AssetContainer $assetContainer)
Populate the backend with a given object
loadFrom(string $path)
Populate the backend from a local path
mixed
getImageResource()
Get the currently assigned image resource
setImageResource(mixed $resource)
Set the currently assigned image resource
array
writeToStore(AssetStore $assetStore, string $filename, string $hash = null, string $variant = null, array $config = [])
Write to the given asset store
bool
writeTo(string $path)
Write the backend to a local path
setQuality(int $quality)
Set the quality to a value between 0 and 100
Image_Backend
resize(int $width, int $height)
Resize an image, skewing it as necessary.
Image_Backend
resizeRatio(int $width, int $height, bool $useAsMinimum = false)
Resize the image by preserving aspect ratio. By default, it will keep the image inside the maxWidth and maxHeight. Passing useAsMinimum will make the smaller dimension equal to the maximum corresponding dimension
Image_Backend
resizeByWidth(int $width)
Resize an image by width. Preserves aspect ratio.
Image_Backend
resizeByHeight(int $height)
Resize an image by height. Preserves aspect ratio.
Image_Backend
paddedResize(int $width, int $height, string $backgroundColor = "FFFFFF", int $transparencyPercent = 0)
Return a clone of this image resized, with space filled in with the given colour
Image_Backend
croppedResize(int $width, int $height)
Resize an image to cover the given width/height completely, and crop off any overhanging edges.
Image_Backend
crop(int $top, int $left, int $width, int $height)
Crop's part of image.