This ZF2 module, once enabled, allows image resizing and manipulation by url.
- PHP 5.3+
- Zend Framework 2 (> 2.0)
- Imagine (> 0.5)
Define dependencies in your composer.json file
{
"require": {
"tck/zf2-imageresizer": "1.*"
}
}
-
Enabling it in your
application.config.php
file.<?php return array( 'modules' => array( // ... 'TckImageResizer', ), // ... );
-
Create "processed" folder in "public" folder.
All files in public folder
- folder/filename.ext
processed/
folder/filename.$command1,param1,param2$command2
.ext
Example: Create a thumbnail and grayscale image
- img/logo.jpg
processed/
img/logo.$thumb,160,120$grayscale
.jpg
- thumb(width, height)
- resize(width, height)
- grayscale
- negative
- gamma(correction)
- colorize(hexColor)
- sharpen
- blur(sigma = 1)
Own commands possible - example place a watermark (Todo Documentation)
- View Helper
- More commands
- More command options
- Administrative functions
- ...