Download the PHP package codem/thumbylla without Composer
On this page you can find all versions of the php package codem/thumbylla. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codem/thumbylla
More information about codem/thumbylla
Files in codem/thumbylla
Package thumbylla
Short Description Thumbylla - a Thumbor integration for Silverstripe image assets
License
Informations about the package thumbylla
Thumbylla
Thumbor'd Silverstripe 4 Images including support for protected image assets
This module pushes image thumbnail generation to a Thumbor open source image server.
Images generated by Thumbor bypass the standard Intervention backend provided by Silverstripe and are instead generated and served from a Thumbor server. Original images are uploaded and stored in the standard assets location in a Silverstripe installation.
SilverStripe 3 compatible version - v0.1
Future releases for SilverStripe 4 will be tagged v0.2 and up.
This is a new module, considered pre-release at the moment
What is Thumbor?
From the Thumbor website itself:
Thumbor is a smart imaging service. It enables on-demand crop, resizing and flipping of images. It features a very smart detection of important points in the image for better cropping and resizing, using state-of-the-art face and feature detection algorithms
Thumbor is written in Python and is easily installed via PIP and configured using a standard configuration file.
Why should I use it?
Thumbor takes the load off your SilverStripe website. Your web stack is busy processing requests and shouldn't be resizing images on demand.
With this module, your users upload images via the usual SilverStripe upload process (e.g FileField, UploadField) and the system then hands off resizing and cropping to Thumbor, via a specific URL.
The Thumbor server can exist anywhere, provided the URLs for the Thumbor generated images point to it and the Thumbor server can access source images. You can have multiple Thumbor servers each with multiple upstreams all handling requests.
Other advantages:
- Thumbor supports webp output using the filter
- Apply multiple filters on the go to a single image
- Apply a cache lifetime to generated thumbnails
- Use a variety of backends to store generated images (e.g Redis, Mongo, S3) or implement your own.
- Put a frontend cache in front of Thumbor image servers.
- Is compatible with Pagespeed
What does a Thumbor URL look like?
Where:
- http(s) - there is no reason why you shouldn't be using https
- thumbor-server - your Thumbor server host name
- hmac - signature of the request, so your disks don't get filled up with thumbs!
- trim - removes surrounding space
- AxB:CxD means manually crop the image at left-top point AxB and right-bottom point CxD;
- fit-in means that the generated image should not be auto-cropped and otherwise just fit in an imaginary box specified by ExF;
- -Ex-F means resize the image to be ExF of width per height size. The minus signs mean flip horizontally and vertically;
- HALIGN is horizontal alignment of crop;
- VALIGN is vertical alignment of crop;
- smart means using smart detection of focal points;
- filters can be applied sequentially to the image before returning;
- image-uri is the public URI for the image you want resized.
More info
Best read the docs: https://thumbor.readthedocs.io/
Signed URLs for protected assets
See Protected Assets
Image manipulation in templates
The following standard image manipulation methods are provided for use in templates:
- ScaleWidth
- ScaleHeight
- Fill
- Pad
- Fit
- ResizedImage
- CMSThumbnail, AssetLibraryThumbnail, AssetLibraryPreview, StripThumbnail
Note that ResizedImage in this module preserves aspect ratio.
The module also provides some extra image manipulation methods in templates:
- FlipVertical - flip an original image vertically e.g
- FlipHorizontal - flip an original image horizontally e.g
- ScaleWidthFlipVertical - scale the image by width and flip it vertically e.g
- ScaleWidthFlipHorizontal - scale the image by width and flip it horizontally e.g
- ScaleHeightFlipVertical - scale the image by height and flip it vertically e.g
- ScaleHeightFlipHorizontal - scale the image by height and flip it horizontally e.g
- ManualCropFromCorners - manually crop and image from its corners e.g
- Focal - crop an image around a Focal point e.g
- CroppedFocus - crop an image on a focal point based on stored crop data e.g
- ManualCrop - crop the image to the exact dimensions returned from the cropping tool
Filters are provided via the method and can be chained, for example the following template code:
... will increase the brightness by 20%, increase saturation by 3%, sharpen with an amount of 8, then scale the image to 360px width. Images are not generated until the URL is requested by the web browser/client.
Filters are extremely powerful, the full list is available here. To use a filter in a template, use the parameters in the same order as described on the relevant Thumbor filter page.
Example
For Sharpen, adding to your template will display a sharpened version of the image with a sharpen_amount=7, sharpen_radius=1 and sharpening of the luminance channel only turned on.
Gotchas
Restarting the filters.
When you want to manipulate the same image mutiple times in a template, you will need to reset filters on the image:
Compare:
With:
Filters that need an extra command
Some filters require others to return the relevant image URL. Return the current filter instance by calling in the template. This is only required for specific filter actions that do not return the Thumbor image URL.
Configuring a Thumbor Server
Check out the module docs here
Silverstripe Configuration
The module ships with the configuration to handle image manipulation via Thumbor turned off. This allows you to switch back to the default Silverstripe image handling by removing project configuration.
If you view the module Yaml config, a number of configuration options are commented out, use these in your own project configuration. To use the module, create the configuration in your own project Yaml, based on the module configuration:
The below example config shows a basic setup. You will need to have a running Thumbor server before enabling the configuration.
Documentation
Documentation is updated from time-to-time
Known Issues + Issue Tracking
Please use the Github Issue Tracker to ask questions/report bugs.
Libraries + Building
This module makes use of cropperjs and react-cropper for image cropping and focal point handling.
All required assets are in client/dist/js|styles. If you want to build your own you will need Node and Yarn, then:
You can then run or , for instance.
Licence
See LICENCE
All versions of thumbylla with dependencies
99designs/phumbor Version ~1.2
guzzlehttp/guzzle Version ~6.0