Download the PHP package tomatom/picture-bundle without Composer
On this page you can find all versions of the php package tomatom/picture-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tomatom/picture-bundle
More information about tomatom/picture-bundle
Files in tomatom/picture-bundle
Informations about the package picture-bundle
TomAtom/PictureBundle
Symfony Bundle for easy <picture>s :)
define breakpoints and use your assets as picture sources, without annoying image conversions and long code blocks
Dependencies:
-
vipsthumbnail
from libvips symfony/framework-standard-edition ">=2.8|~3.3"
Installation:
-
you need
vipsthumbnail
!, (install bysudo apt install libvips-tools
, or you can compile your own or download here) -
create project with Symfony framework
-
composer require tomatom/picture-bundle "1.4"
-
add bundle to AppKernel.php:
-
update db schema, install assets and clear cache ... and it's done!
- optionally add parameters to parameters.yml(.dist) (define your own breakpoints etc.):
Usage:
- in template, call (jpg, png and gif are supported):
<picture> is generated and image is converted on first render
-
you can define custom breakpoints and/or jpeg quality for each image, when needed:
- you can retrieve converted images in PHP code too (in case you need to serve images from API, etc.), like this:
Todo:
- [x] jpeg quality as param
- [x] jpeg quality as param in template
- [x] breakpoints as param in template
- [ ] cmd for batch converting
- [x] converting of images other than assets (like from 'web/uploads', etc)
- [x] helper for retrieving converted images in controller / cmd / service..
- [x] helper for SonataMedia image path