neutron / silex-imagine-provider
A Silex service provider for Imagine Image Processing Library
Installs: 197 238
Dependents: 4
Suggesters: 0
Security: 0
Stars: 26
Watchers: 3
Forks: 13
Open Issues: 0
Requires
- php: >=5.3.3
- imagine/imagine: *
- silex/silex: ~1.0
Requires (Dev)
- symfony/browser-kit: ~2.0
This package is auto-updated.
Last update: 2024-11-25 06:45:51 UTC
README
Usage
use Imagine\Image\Box; use Neutron\Silex\Provider\ImagineServiceProvider; use Silex\Application; use Symfony\Component\HttpFoundation\Request; $app = new Application(); // detect a driver for you $app->register(new ImagineServiceProvider()); // OR choose your own driver $app->register(new ImagineServiceProvider(), array('imagine.driver' => 'Gmagick')); $app->match('/image-resize', function(Request $request) use ($app) { $app['imagine'] ->open($request->files->get('image')->getPathname()) ->resize(new Box(320, 240)) ->save('/path/to/data/image-resized.jpg'); return 'Image resized !'; }); $app->run();
##License
MIT License