hydrakit / image
Image variants for Hydra: a picture resized to the widths a page needs, as WebP, upright and without metadata.
Requires
- php: >=8.4
- ext-exif: *
- ext-gd: *
- hydrakit/console: ^0.31
- hydrakit/core: ^0.31
- hydrakit/filesystem: ^0.31
- hydrakit/view: ^0.31
- psr/log: ^3.0
Requires (Dev)
- phpunit/phpunit: ^11.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-08 22:26:57 UTC
README
Part of the Hydra PHP framework. Documentation: hydra.williamhleucka.com/docs.
Read-only mirror.
hydrakit/imageis developed in hydra-foundation/hydra underpackages/image, and republished here on every push. A commit pushed to this repository is overwritten by the next one; issues are disabled for that reason, and a pull request opened here cannot be merged. Both belong upstream.
One picture at the sizes a page needs. It implements hydrakit/view's
ImagesInterface, so a view says
<?= $this->image('/images/garden.jpg', 'content', alt: 'The garden') ?> and
gets an <img> with a srcset of WebP copies, its width and height, and lazy
loading.
The copies are made with GD the first time a page asks for them and kept on the
public disk, where the web server serves them from then on. They are upright
(EXIF orientation applied), carry no metadata (no GPS), and are never wider
than the source. A source over the megapixel limit is refused before it is
decoded. Needs ext-gd with JPEG and WebP support, and ext-exif.