Difference between #12 and #13 of
How to use imagine ( crop, thumb, effects for images ) on Yii2

Revision #13 has been created by Cozumel on Jan 5, 2016, 5:43:46 PM with the memo:

Added resize example
« previous (#12)

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
[...]
4 0
12 followers
Viewed: 63 692 times
Version: 2.0
Category: Tutorials
Written by: Anas AbuDayah
Last updated by: Cozumel
Created on: Oct 15, 2014
Last updated: 2 years ago
Update Article

Revisions

View all history