xj / yii2-kohanaimage
yii2-kohanaimage
4.0.3
2015-03-18 15:03 UTC
Requires
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-11-10 19:42:51 UTC
README
composer.json
"require": {
"yii2-kohanaimage": "*"
},
Example
header("Content-Type: image/jpg");
$pathToFile = 'f:/1.jpg';
$pathToFile2 = 'f:/2.jpg';
echo Image::load($pathToFile)->render('png');
echo Image::load($pathToFile)->crop(100, 100)->render();
echo Image::load($pathToFile)->resize(100, 100, Image::INVERSE)->render();
echo Image::load($pathToFile)->resize(100, null)->render();
echo Image::load($pathToFile)->resize(null, 100)->render();
echo Image::load($pathToFile)->rotate(45)->render();
echo Image::load($pathToFile)->resize(400, null)->sharpen(20)->render();
echo Image::load($pathToFile)->rotate(45)->watermark(Image::load($pathToFile2))->render();
Properties
Image::load($pathToFile)->width;
Image::load($pathToFile)->height;
Image::load($pathToFile)->type;
Image::load($pathToFile)->mime;
Methods
background()
crop()
factory()
flip()
reflection()
render()
resize()
rotate()
save()
sharpen()
watermark()
Ref
http://kohanaframework.org/3.2/guide/api/Image