Recipes
Each recipe solves one task and shows the URL it builds. Every example was run against the library, and the comment shows the result. Where a value changes between runs, such as a signature or timestamp, a placeholder in braces stands in for it, and an ellipsis marks output that is shortened.
The recipes share one base builder:
use SomehowDigital\ImgProxy\Url;
$base = Url::create()->source('https://example.com/photos/cat.jpg');Recipes
Section titled “Recipes”- Thumbnails: square crops around the subject.
- Responsive images: one URL per width of a
srcset, and HiDPI screens. - Format conversion: modern formats, per-format quality, and transparency to JPEG.
- Watermarks: place the configured watermark.
- Downloads: serve an image as a file with a chosen name.
- Strip metadata: remove EXIF and other metadata.
- Secure URLs: sign, mask and expire URLs.
For the building blocks, see Building URLs and the options reference.