diff --git a/README.md b/README.md index 7fc0a59..8e08253 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@

- + -

Yii2-Template.

+

Imagine


@@ -13,32 +13,57 @@ yii2-version - - PHPUnit + + PHPUnit - - Codecov - - + + Codecov + + PHPStan - - PHPStan level - - - Code style + + PHPStan level + + + Code style

-## Requirements +## Installation + +The preferred way to install this extension is through [composer](https://getcomposer.org/download/). + +Either run -The minimun version of `PHP` required by this package is `PHP 8.1`. +``` +php composer.phar require --dev --prefer-dist yii2-extensions/imagine +``` -For install this package, you need [composer](https://getcomposer.org/). +or add + +``` +"yii2-extensions/imagine": "dev-main" +``` + +to the require-dev section of your `composer.json` file. ## Usage -[Check the documentation docs](/docs/README.md) to learn about usage. +This extension is a wrapper to the [Imagine](https://imagine.readthedocs.org/) and also adds the most commonly used +image manipulation methods. + +The following example shows how to use this extension: + +```php +use yii\imagine\Image; + +// frame, rotate and save an image +Image::frame('path/to/image.jpg', 5, '666', 0) + ->rotate(-8) + ->save('path/to/destination/image.jpg', ['jpeg_quality' => 50]); +``` + ## Testing