Codem\Thumbor\ThumbyllaImageBackend
An Image Backend for Thumbor-based image handling, replacing the InterventionBackend Remember, the actual 'backend' is the Thumbor Server, all we do is create image URLs ;)
Synopsis
class ThumbyllaImageBackend
implements
Image_Backend
{
- // constants
- const USER_AGENT = "Thumbylla";
- // members
- private Builder $thumbor_url;
- private $image;
- private string $halign = "center";
- private string $valign = "middle";
- private $quality;
- private AssetContainer $container;
- // methods
- public void __construct()
- public $this setAssetContainer()
- public void getRemoteResponse()
- public int getWidth()
- public int getHeight()
- protected void pickBackendHost()
- protected void getProtocol()
- public void getSecretKey()
- protected static void getProtectedSigningKey()
- private void generateUrlInstance()
- protected void signURL()
- private void UrlInstance()
- public void getUrlInstance()
- public void hasCommands()
- public void currentUrl()
- public void ResetFilters()
- public void isSize()
- public void isWidth()
- public void isHeight()
- public void Align()
- public void getHalign()
- public void getValign()
- public void Smart()
- public void Filters()
- public void Filter()
- public void ManualCropFromCorners()
- public void Focal()
- public void ManualCrop()
- public void getFormattedImage()
- public void loadFromContainer()
- public void loadFrom()
- public array writeToStore()
- public void writeTo()
- public void setQuality()
- public int getQuality()
- public void setImageResource()
- public mixed getImageResource()
- public boolean hasImageResource()
- 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()
- public boolean imageAvailable()
- public void onBeforeDelete()
Hierarchy
Implements
- SilverStripe\Assets\Image_Backend
Tasks
Line | Task |
---|---|
122+ | this should not be public |
Constants
Name | Value |
---|---|
USER_AGENT | "Thumbylla" |
Members
private
- $container — SilverStripe\Assets\Storage\AssetContainer
- $halign
- $image
- $quality
- $thumbor_url — Codem\Thumbor\Thumbor\Url\Builder
- $valign
Methods
private
- UrlInstance() — Create an instance of Thumbor\Url\Builder for this image, if it doesn't already exist
- generateUrlInstance()
protected
- getProtectedSigningKey() — This is NOT the key used to validate/sign images, it's used to generate a token for protected image access
- getProtocol() — Get the protocol of the Thumbor image servers
- pickBackendHost() — Based on config, pick a server to serve an image
- signURL()
public
- __construct() — Create a new backend with the given object
- Align() — Align the crop (for Fill/CroppedImage)
- Filter() — Add single filter. Note that the addFilter arguments can be completely arbitrary.
- Filters() — Add multiple filters
- Focal() — Supply focal per http://thumbor.readthedocs.io/en/latest/focal.html, noting this warning: http://thumbor.readthedocs.io/en/latest/focal.html#warning
- ManualCrop() — Crop the image using Thumbor manual crop handling based on image crop data
- ManualCropFromCorners() — Shortcut method to crop an image from its edges, e.g 20,20,20,20 crops the image 20 pixels in from each edge
- ResetFilters() — Reset the current thumbor_url - see {@link Codem\Thumbor\Image::Restart()}
- Smart() — Enable Smart Cropping on this instance. It cannot be turned off once enabled.
- crop() — Crop's part of image.
- croppedResize() — croppedResize
- currentUrl()
- getFormattedImage()
- getHalign()
- getHeight()
- getImageResource() — getImageResource - not implemented
- getQuality()
- getRemoteResponse()
- getSecretKey() — Get secret key shared with the thumbor server to generate images. If this is exposed, anyone with it can create images from allowed hosts
- getUrlInstance() — Retrieve the Thumbor\Url\Builder instance for this image, mainly used in tests
- getValign()
- getWidth()
- hasCommands()
- hasImageResource() — hasImageResource - not implemented
- imageAvailable() — imageAvailable
- isHeight() — This always returns false to force {@link self::getFormattedImage} to be called
- isSize() — This always returns false to force {@link self::getFormattedImage} to be called
- isWidth() — This always returns false to force {@link self::getFormattedImage} to be called
- loadFrom() — Populate the backend from a local path
- loadFromContainer() — Populate the backend with a given object
- onBeforeDelete() — onBeforeDelete
- paddedResize() — paddedResize
- resize() — resize
- resizeByHeight() — resizeByHeight
- resizeByWidth() — resizeByWidth
- resizeRatio() — resizeRatio
- setAssetContainer()
- setImageResource() — setImageResource - not implemented
- setQuality() — setQuality - if set, will modify the quality in a filter
- writeTo() — writeTo - not implemented
- writeToStore() — Write to the given asset store