Changes
Title
unchanged
How to use imagine ( crop, thumb, effects for images ) on Yii2
Category
unchanged
Tutorials
Yii version
unchanged
Tags
unchanged
image, yii2, extensions, tutorial
Content
changed
[...]
Image::thumbnail('@webroot/img/test-photo.jpg', 120, 120)
->save(Yii::getAlias('@runtime/thumb-test-photo.jpg'), ['quality' => 80]);
```
### Resizing and Preserving Aspect Ratio
```php
use yii\imagine\Image;
use Imagine\Gd;
use Imagine\Image\Box;
use Imagine\Image\BoxInterface;
Image::getImagine()->open($fileName)->thumbnail(new Box($newWidth, $newHeight))->save($savePath , ['quality' => 90]);
```
### Effects
[More effects](https://imagine.readthedocs.org/en/latest/usage/effects.html "More effects")
#### Grayscale[...]