Download the PHP package storyblok/php-image-service without Composer
On this page you can find all versions of the php package storyblok/php-image-service. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download storyblok/php-image-service
More information about storyblok/php-image-service
Files in storyblok/php-image-service
Package php-image-service
Short Description PHP Client for Storyblok Image Service
License MIT
Informations about the package php-image-service
Storyblok PHP Image Service
Co-created with SensioLabs, the creators of Symfony.
| Branch | PHP | Code Coverage |
|---|---|---|
master |
[!WARNING] This package is currently experimental. Breaking changes may be introduced with any release until a stable version is reached. Use with caution in production environments.
Installation
Usage
Fluent Interface
The Image class supports a fluent interface, allowing you to chain multiple operations together. Each method returns a new Image instance, making the original instance immutable.
Available Operations
Resize
Resize an image to specific dimensions. If only width or height is provided, the other dimension will be calculated to maintain the aspect ratio.
Fit-In
Fit the image within a given width and height while maintaining aspect ratio.
Crop
Crop the image by specifying the top-left and bottom-right coordinates.
Format
Convert the image to a different format. Supported formats: webp, jpeg, png, avif.
Quality
Set the image quality (0-100).
Blur
Apply a blur effect with radius (0-150) and optional sigma (0-150).
Brightness
Adjust image brightness (-100 to 100).
Rotate
Rotate the image by a specific angle. Only 0, 90, 180, and 270 degrees are supported.
Flip
Flip the image horizontally or vertically.
Grayscale
Convert the image to grayscale.
Focal Point
Set a focal point for smart cropping using a string in format x1xy1:x2xy2.
Rounded Corners
Apply rounded corners to the image.
Fill
Set a fill color for fit-in operations. Accepts transparent or a hex color code.
No Upscale
Prevent the image from being upscaled beyond its original dimensions.
Get Image Metadata
Retrieve information about the image.
Limitations
The following limitations apply:
- URL Format: The image URL must contain dimensions in the format
/{width}x{height}/(e.g.,/1400x900/). URLs without this pattern will throw anInvalidArgumentException. - Rotation Angles: Only 0, 90, 180, and 270 degree rotations are supported. Arbitrary angles are not available.
- Blur Constraints: The blur sigma cannot be set to a value greater than 0 when the radius is 0.
- Quality Range: Quality must be between 0 and 100.
- Brightness Range: Brightness must be between -100 and 100.
- Blur Range: Both radius and sigma must be between 0 and 150.
- RGB Values: For rounded corners, RGB values must be between 0 and 255.
- Format Values: Format must be one of
webp,jpeg,png, oravif.
License
This project is licensed under the MIT License. Please see License File for more information.
All versions of php-image-service with dependencies
oskarstark/enum-helper Version ^1.5
oskarstark/trimmed-non-empty-string Version ^1.1
thecodingmachine/safe Version ^3.0
webmozart/assert Version ^1.11 || ^2.0