Download the PHP package netwerkstatt/silverstripe-image-toolkit without Composer
On this page you can find all versions of the php package netwerkstatt/silverstripe-image-toolkit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download netwerkstatt/silverstripe-image-toolkit
More information about netwerkstatt/silverstripe-image-toolkit
Files in netwerkstatt/silverstripe-image-toolkit
Package silverstripe-image-toolkit
Short Description A Silverstripe module with various image manipulations (Watermark, AutoOrient, ColorOverlay, etc.) via Intervention Image.
License BSD-3-Clause
Informations about the package silverstripe-image-toolkit
Silverstripe Image Toolkit
This module provides a collection of image manipulations for Silverstripe CMS using Intervention Image V3. It's specifically designed for Silverstripe 6 and leverages the power of the Intervention Image library for various effects and optimizations.
Installation
Features
- Watermark: Add a logo or image as a watermark. Supports flexible positioning, padding, opacity, and relative sizing. Now also stable against circular references when using
Imageobjects or their IDs. - Auto-Orient: Automatically corrects image orientation based on EXIF data (ideal for mobile uploads).
- Color Overlay: Places a semi-transparent color over an image (useful for banners and hero sections).
Configuration
The toolkit is automatically registered for SilverStripe\Assets\Image and SilverStripe\Assets\Storage\DBFile. You can customize default settings via YAML.
Watermark Configuration
Usage
In your templates or PHP code, you can use the toolkit methods on any Image or DBFile object.
Watermark
Adds a watermark to the image. You can pass an Image object, an ID, or a path.
Note: Using the ID ($Logo.ID) is particularly stable as the object is only loaded when needed. However, this also prevents circular reference errors when passing whole objects.
Auto-Orient (Alias: AutoOriented)
Corrects the orientation of an image based on its EXIF data.
Color Overlay (Alias: ColorOverlayed)
Applies a color overlay. Perfect for making text more readable on images.
Chaining
All methods are "fluent" and can be combined:
Advanced: Watermark Logo Hook
You can dynamically change the watermark logo (e.g., from SiteConfig) using the updateWatermarkLogo hook:
Requirements
- PHP ^8.2
- Silverstripe Framework ^6
- Silverstripe Assets ^3
License
See LICENSE