Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
52ad66e3
Commit
52ad66e3
authored
Dec 30, 2013
by
Antonio Ramirez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added README file
parent
1bde5e0d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
+71
-0
README.md
extensions/yii/imagine/README.md
+71
-0
No files found.
extensions/yii/imagine/README.md
0 → 100644
View file @
52ad66e3
Image Extension for Yii 2
==============================
This extension adds most common image functions and also acts as a wrapper to
[
Imagine
](
http://imagine.readthedocs.org/
)
image manipulation library.
Installation
------------
The preferred way to install this extension is through
[
composer
](
http://getcomposer.org/download/
)
.
Either run
```
php composer.phar require yiisoft/yii2-imagine "*"
```
or add
```
json
"yiisoft/yii2-imagine"
:
"*"
```
to the
`require`
section of your composer.json.
Usage & Documentation
---------------------
This extension is a wrapper to the
[
Imagine
](
http://imagine.readthedocs.org/
)
and also adds the most common methods
used for Image manipulation.
To use this extension, you can use it in to ways, whether you configure it on your application file or you use it
directly.
The following shows how to use it via application configuration file:
```
// configuring on your application configuration file
'components' => [
'image' => [
'class' => 'yii\imagine\Image',
'driver' => \yii\imagine\Image::DRIVER_GD2,
]
...
]
// Once configured you can access to the extension like this:
$img = Yii::$app->image->thumb('path/to/image.jpg', 120, 120);
```
This is how to use it directly:
```
use yii\imagine\Image;
$image = new Image();
$img = $image->thumb('path/to/image.jpg', 120, 120);
```
**About the methods**
Each method returns an instance to
`\Imagine\Image\ManipulatorInterface`
, that means that you can easily make use of the methods included in the
`Imagine`
library:
```
// frame, rotate and save an image
Yii::$app->image->frame('path/to/image.jpg', 5, '666', 0)
->rotate(-8)
->save('path/to/destination/image.jpg', ['quality' => 50]);
```
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment