PHPackages                             mauglee/yii2-easyimage - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. mauglee/yii2-easyimage

ActiveYii2-extension[Image &amp; Media](/categories/media)

mauglee/yii2-easyimage
======================

Image Component for Yii2

1.0.2(9y ago)020MITPHP

Since Nov 30Pushed 9y ago1 watchersCompare

[ Source](https://github.com/mauglee/yii2-easyimage)[ Packagist](https://packagist.org/packages/mauglee/yii2-easyimage)[ RSS](/packages/mauglee-yii2-easyimage/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Image Component for Yii2
========================

[](#image-component-for-yii2)

Image Component for Yii2

This extension is based on [yii-easyImage](https://github.com/zhdanovartur/yii-easyimage)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require mauglee/yii2-easyimage

```

or add

```
"mauglee/yii2-easyimage": "@dev"

```

to the `require-dev` section of your `composer.json` file.

Usage
-----

[](#usage)

Once the extension is installed, simply modify your application configuration as follows:

```
return [
    'components' => [
        'easyImage' => [
            'class'         => 'cliff363825\image\EasyImage',
            'driver'        => 'GD',
            'quality'       => 100,
            'cachePath'     => '/easyimage/',
            'cacheTime'     => 2592000,
            'retinaSupport' => true,
            'pixel_ratio'   => [ 2, 3 ], // Device pixels per CSS pixel (retina stuff)
            'basePath'      => '@webroot',
            'baseUrl'       => '@web',
        ]
    ],
];
```

#### Parameters

[](#parameters)

- string `$file` required - Image file path
- string `$driver` - Driver: `GD`, `Imagick`

### ThumbOf

[](#thumbof)

You can create a thumbnail directly in the `View`:

// Create and autocache

```
Yii::$app->easyImage->thumbOf('/path/to/image.jpg', ['rotate' => 90]);
```

// or

```
Yii::$app->easyImage->thumbOf('image.jpg', ['rotate' => 90],  ['class' => 'image']);
```

// or

```
Yii::$app->easyImage->thumbOf('image.png', [
    'resize' => ['width' => 100, 'height' => 100],
    'rotate' => ['degrees' => 90],
    'sharpen' => 50,
    'background' => '#ffffff',
    'type' => 'jpg',
    'quality' => 60,
  ]);
```

**Note.** This method return [Html::img()](http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html)

Example using different filetypes, diferrent images source path:

```
// in real situation those filenames are retrieved from DB
$images = [
    '01.jpg',
    '02.jpg',
    '03.png',
];

foreach ( $images as $image ) {
    $file_path = Yii::getAlias( '@app/data/image/logo/' ) . $image;
    if ( is_file( $file_path ) ) {
        echo Yii::$app->easyImage->thumbOf( $file_path, [
            'resize'  => [ 'width' => 300, 'height' => 300 ],
            'type'    => 'jpg',
            'quality' => '86',
        ] );
    }
}
```

#### Parameters

[](#parameters-1)

- string `$file` required - Image file path
- array `$params` - Image manipulation methods
- array `$htmlOptions` - options for Html::img()

For full details on usage, see the [documentation on authors page](https://github.com/zhdanovartur/yii-easyimage). **Note:** Some differencies may occur, because original version is written for Yii v1

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~113 days

Total

3

Last Release

3590d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/192ca651997fe49748406f851f775732716c92a8471a3a9fec0d264808a02ce5?d=identicon)[mauglee](/maintainers/mauglee)

---

Top Contributors

[![AxelPAL](https://avatars.githubusercontent.com/u/3734332?v=4)](https://github.com/AxelPAL "AxelPAL (4 commits)")

---

Tags

imageyii2

### Embed Badge

![Health badge](/badges/mauglee-yii2-easyimage/health.svg)

```
[![Health](https://phpackages.com/badges/mauglee-yii2-easyimage/health.svg)](https://phpackages.com/packages/mauglee-yii2-easyimage)
```

###  Alternatives

[raoul2000/yii2-jcrop-widget

This extension is a wrapper for the jQuery Image Cropping Plugin (jcrop)

10248.3k2](/packages/raoul2000-yii2-jcrop-widget)[noam148/yii2-image-resize

A Yii2 component for resizing images (on the fly)

1144.6k7](/packages/noam148-yii2-image-resize)[maxmirazh33/yii2-uploadable-cropable-image

Yii2 extension for upload and crop images

1020.8k](/packages/maxmirazh33-yii2-uploadable-cropable-image)[alex-bond/yii2-thumbler

Library for auto-creating thumbs of images

112.1k](/packages/alex-bond-yii2-thumbler)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
