InterventionBackend
class InterventionBackend implements Image_Backend, Flushable (View source)
Traits
Provides extensions to this object to integrate it with standard config API methods.
Constants
CACHE_MARK |
Cache prefix for marking |
CACHE_DIMENSIONS |
Cache prefix for dimensions |
FAILED_INVALID |
This file is invalid because it is not image data, or it cannot
be processed by the given backend |
FAILED_MISSING |
This file is invalid as it is missing from the filesystem |
FAILED_UNKNOWN |
Some unknown error |
Properties
static private bool | $flush_enabled | Is cache flushing enabled? |
|
static private array | $error_cache_ttl | How long to cache each error type |
|
static private string | $local_temp_path | Configure where cached intervention files will be stored |
Methods
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).
Gets the uninherited value for the given config option
No description
No description
No description
No description
No description
No description
No description
Get the currently assigned image resource, or generates one if not yet assigned.
Populate the backend from a local path
No description
Write to the given asset store
Write the backend to a local path
No description
No description
No description
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.
Make sure we clean up the image resource when this object is destroyed
This function is triggered early in the request if the "flush" query parameter has been set. Each class that implements Flushable implements this function which looks after it's own specific flushing functionality.
Details
static Config_ForClass
config()
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).
mixed
stat(string $name)
deprecated
deprecated
Get inherited config value
mixed
uninherited(string $name)
Gets the uninherited value for the given config option
$this
set_stat(string $name, mixed $value)
deprecated
deprecated
Update the config value for a given property
__construct(AssetContainer $assetContainer = null)
Create a new backend with the given object
string
getTempPath()
$this
setTempPath(string $path)
CacheInterface
getCache()
$this
setCache(CacheInterface $cache)
AssetContainer
getAssetContainer()
$this
setAssetContainer(AssetContainer $assetContainer)
ImageManager
getImageManager()
$this
setImageManager(ImageManager $manager)
loadFromContainer(AssetContainer $assetContainer)
Populate the backend with a given object
mixed
getImageResource()
Get the currently assigned image resource, or generates one if not yet assigned.
Note: This method may return null if error
loadFrom(string $path)
Populate the backend from a local path
setImageResource(Image $image)
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
int
getQuality()
int
getWidth()
int
getHeight()
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.
__destruct()
Make sure we clean up the image resource when this object is destroyed
static
flush()
This function is triggered early in the request if the "flush" query parameter has been set. Each class that implements Flushable implements this function which looks after it's own specific flushing functionality.