SilverStripe\Assets\Image_Backend
Image_Backend
A backend for manipulation of images via the Image class
Synopsis
interface Image_Backend
{
- // constants
- const ORIENTATION_SQUARE = 0;
- const ORIENTATION_PORTRAIT = 1;
- const ORIENTATION_LANDSCAPE = 2;
- // methods
- public void __construct()
- public int getWidth()
- public int getHeight()
- public void loadFromContainer()
- public void loadFrom()
- public mixed getImageResource()
- public void setImageResource()
- public array writeToStore()
- public bool writeTo()
- public void setQuality()
- public Image_Backend resize()
- public Image_Backend resizeRatio()
- public Image_Backend resizeByWidth()
- public Image_Backend resizeByHeight()
- public Image_Backend paddedResize()
- public Image_Backend croppedResize()
- public Image_Backend crop()
Constants
Name | Value |
---|---|
ORIENTATION_SQUARE | 0 |
ORIENTATION_PORTRAIT | 1 |
ORIENTATION_LANDSCAPE | 2 |
Methods
public
- __construct() — Create a new backend with the given object
- crop() — Crop's part of image.
- croppedResize() — Resize an image to cover the given width/height completely, and crop off any overhanging edges.
- getHeight()
- getImageResource() — Get the currently assigned image resource
- getWidth()
- loadFrom() — Populate the backend from a local path
- loadFromContainer() — Populate the backend with a given object
- paddedResize() — Return a clone of this image resized, with space filled in with the given colour
- resize() — Resize an image, skewing it as necessary.
- resizeByHeight() — Resize an image by height. Preserves aspect ratio.
- resizeByWidth() — Resize an image by width. Preserves aspect ratio.
- resizeRatio() — 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
- setImageResource() — Set the currently assigned image resource
- setQuality() — Set the quality to a value between 0 and 100
- writeTo() — Write the backend to a local path
- writeToStore() — Write to the given asset store