Image_Backend
interface Image_Backend
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
at line 36
__construct(AssetContainer $assetContainer = null)
Create a new backend with the given object
at line 41
int
getWidth()
at line 46
int
getHeight()
at line 53
loadFromContainer(AssetContainer $assetContainer)
Populate the backend with a given object
at line 60
loadFrom(string $path)
Populate the backend from a local path
at line 67
mixed
getImageResource()
Get the currently assigned image resource
at line 74
setImageResource(mixed $resource)
Set the currently assigned image resource
at line 87
array
writeToStore(AssetStore $assetStore, string $filename, string $hash = null, string $variant = null, array $config = array())
Write to the given asset store
at line 95
bool
writeTo(string $path)
Write the backend to a local path
at line 102
setQuality(int $quality)
Set the quality to a value between 0 and 100
at line 111
Image_Backend
resize(int $width, int $height)
Resize an image, skewing it as necessary.
at line 123
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
at line 131
Image_Backend
resizeByWidth(int $width)
Resize an image by width. Preserves aspect ratio.
at line 139
Image_Backend
resizeByHeight(int $height)
Resize an image by height. Preserves aspect ratio.
at line 150
Image_Backend
paddedResize(int $width, int $height, string $backgroundColor = "FFFFFF", int $transparencyPercent)
Return a clone of this image resized, with space filled in with the given colour
at line 159
Image_Backend
croppedResize(int $width, int $height)
Resize an image to cover the given width/height completely, and crop off any overhanging edges.
at line 169
Image_Backend
crop(int $top, int $left, int $width, int $height)
Crop's part of image.