InterventionDriver
abstract class InterventionDriver implements Driver
Properties
| protected Transformation>, callable> | $transformationHandlers | The registered transformation handlers. |
|
| protected ImageManagerInterface | $manager | The Intervention image manager instance. |
Methods
Create a new Intervention driver instance.
Create the underlying Intervention image manager.
Ensure Intervention Image is installed.
Process the given image contents with the specified pipeline.
Get the dimensions of the given image contents.
Resolve a background color, expanding the "dominant" sentinel when needed.
Get the dominant (average) color of the image as a hex string.
Sample the dominant color by resizing the image to a single pixel.
Register a transformation handler.
Get the handler for the given transformation.
Details
at line 57
__construct()
Create a new Intervention driver instance.
at line 66
abstract protected ImageManagerInterface
createManager()
Create the underlying Intervention image manager.
at line 73
void
ensureRequirementsAreMet()
Ensure Intervention Image is installed.
at line 86
string
process(string $contents, ImagePipeline $pipeline)
Process the given image contents with the specified pipeline.
at line 159
array
dimensions(string $contents)
Get the dimensions of the given image contents.
at line 173
protected string|null
resolveBackground(ImageInterface $image, string|null $background)
Resolve a background color, expanding the "dominant" sentinel when needed.
at line 183
string
dominantColor(string $contents)
Get the dominant (average) color of the image as a hex string.
at line 197
protected string
dominantColorFrom(ImageInterface $image)
Sample the dominant color by resizing the image to a single pixel.
at line 216
Driver
transformUsing(string $transformation, callable $callback)
Register a transformation handler.
On a cached driver, the handler persists for the worker lifetime and affects every subsequent image processed by it.
at line 227
protected callable|null
transformationHandlerFor(Transformation $transformation)
Get the handler for the given transformation.