yiisoft/yii2 — pull request #1669 by tonydspaniard (2013-12-28 08:20:16+00:00)
Title: [wip] Proposal for #46: Implementation of Image helper based on Imagine library

Closes #46

Implements common used methods for Image manipulation:

- crop
`Yii::$app->image->crop('/path/to/image.jpg', 200, 200, 720, 450);`
- thumb (keeping aspect ratio)
`Yii::$app->image->thumb('/path/to/image.jpg',120, 120);`
- text
`Yii::$app->image->text('/path/to/image.jpg', 'Yii-2 Image', ['font' => 'path/to/font.otf', 'size' => 12, 'color' =>'000']);`
- watermark
`Yii::$app->image->crop('/path/to/image.jpg', /path/to/watermark.jpg', );`
It uses Imagine library. It also contains a method to access Imagine methods directly (ie when used for simple image manipulations):

```
Yii::$app->image->getImagine()
->open('/path/to/image.jpg')
->save('/path/to/image.jpg', array('quality' => 50));
```

Edit: This extension is on WIP, if accepted. Then will write the tests