PHPackages                             yiicod/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. [Caching](/categories/caching)
4. /
5. yiicod/yii2-easyimage

ActiveYii2-extension[Caching](/categories/caching)

yiicod/yii2-easyimage
=====================

Yii 2 Framework extension for easy creating and caching thumbnails in real time.

1.0.0(8y ago)51.6kMITPHP

Since Feb 18Pushed 8y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (2)Used By (0)

Yii EasyImage extension
=======================

[](#yii-easyimage-extension)

[![Latest Stable Version](https://camo.githubusercontent.com/a6684b66045c73bc0a1573939019807ae04e1491d7e3451e43841d7d5f2cf35f/68747470733a2f2f706f7365722e707567782e6f72672f796969636f642f796969322d65617379696d6167652f762f737461626c65)](https://packagist.org/packages/yiicod/yii2-easyimage) [![Total Downloads](https://camo.githubusercontent.com/c37e838b0102f407dcf86997a31a07d5ad782d4681e2d7bc5e421e6b5f212b82/68747470733a2f2f706f7365722e707567782e6f72672f796969636f642f796969322d65617379696d6167652f646f776e6c6f616473)](https://packagist.org/packages/yiicod/yii2-easyimage) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/e419914d5d48b02ae5f7fc3a60876d20048ba5d478256fbe354e714689f06c1a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f796969636f642f796969322d65617379696d6167652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/yiicod/yii2-easyimage/?branch=master)[![Code Climate](https://camo.githubusercontent.com/86f627da69aff2a981af8f0cd6baf5483bc21b892ff5090ef82b8af66c98195e/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f796969636f642f796969322d65617379696d6167652f6261646765732f6770612e737667)](https://codeclimate.com/github/yiicod/yii2-easyimage)

You don't need to create many types of thumbnails for images in your project. You can create a thumbnail directly in the `View`. Thumbnail will automatically cached. It's easy!

Features:

- Easy to use
- Support `Imagick`, `Gmagick` and `GD2`
- Automatically images caching
- Cache sorting to subdirectories

### Installing and configuring

[](#installing-and-configuring)

Add the following to your config file `components` section:

```
'easyimage' => [
    'class' => 'yiicod\easyimage\EasyImage',
    'webrootAlias' => '@frontend/web',
    'cachePath' => '/uploads/easyimage/',
    'imageOptions' => [
        'quality' => 100
    ],
],
```

#### Parameters

[](#parameters)

- string `webrootAlias` webroot folder path
- string `cachePath` cache directory path in webroot folder
- array `imageOptions` array with default output image options which will used by Imagine to save image

Usage
-----

[](#usage)

```
Yii::$app->easyimage->getUrl($file, $params, $absolute); //Get cached image url
Yii::$app->easyimage->getPath($file, $params); //Get cached image path

Note: you can get access to the component using static method EasyImage::getInstance()
```

#### Parameters

[](#parameters-1)

- string `$file` required - Image file path
- array `$params` image tools params Default: \[\]
- mixed `$absolute` get absolute (true) url or not (false). Will use in Url::to() helper method

### Available tools and parameters

[](#available-tools-and-parameters)

```
'crop' => [
    'width' => 200, //Required
    'height' => 200, //Required
    'offset_x' => 100,
    'offset_y' => 100,
],
'flip' => [
    'axis' => 'vertical', //Required available 'vertical' or 'horizontal'
],
'resize' => [
    'width' => 200, //Required
    'height' => 200, //Required
],
'scale' => [
    'width' => 200, //Required
    'height' => 200, //Required
],
'rotate' => [
    'angle' => 45 //Required
],
'thumbnail' => [
    'width' => 100, //Required one of dimensions
    'height' => 100, //Required one of dimensions
],
'watermark' => [
    'image' => $file, //Required
    'offset_x' => 100,
    'offset_y' => 100,
],
'background' => [
    'color' => '#000', //Required
    'alpha' => 0 //Background color's alpha
],
```

### Tools

[](#tools)

You can add additional tools in config:

```
'easyimage' => [
    'class' => 'yiicod\easyimage\EasyImage',
    'webrootAlias' => '@frontend/web',
    'cachePath' => '/uploads/easyimage/',
    'tools' => [
        'crop' => Crop::class,
    ],
],
```

- 'crop' - tool name which will use in getUrl() or getPath() params
- Crop::class - tool class name which must implement yiicod\\easyimage\\base\\ToolInterface

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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

Unknown

Total

1

Last Release

3004d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7934283ca98b7f31bb5bf13119a8495cad80ac9097125a48792f47caddb588b9?d=identicon)[lexxorlov](/maintainers/lexxorlov)

---

Top Contributors

[![lexxorlov](https://avatars.githubusercontent.com/u/7910574?v=4)](https://github.com/lexxorlov "lexxorlov (3 commits)")[![Mark1Z](https://avatars.githubusercontent.com/u/9988709?v=4)](https://github.com/Mark1Z "Mark1Z (1 commits)")

---

Tags

thumbnailimagecacherealtimeextensionyii

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[undefinedor/yii2-cached-active-record

The cached activeRecord for the Yii2 framework

102.6k](/packages/undefinedor-yii2-cached-active-record)

PHPackages © 2026

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