PHPackages                             porcelanosa/yii2-easy-thumbnail-image-helper - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. porcelanosa/yii2-easy-thumbnail-image-helper

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

porcelanosa/yii2-easy-thumbnail-image-helper
============================================

Yii2 helper for creating and caching thumbnails on real time

1.0.3(5y ago)07MITPHP

Since Sep 29Pushed 5y ago1 watchersCompare

[ Source](https://github.com/porcelanosa/yii2-easy-thumbnail-image-helper)[ Packagist](https://packagist.org/packages/porcelanosa/yii2-easy-thumbnail-image-helper)[ RSS](/packages/porcelanosa-yii2-easy-thumbnail-image-helper/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (2)Versions (5)Used By (0)

Easy Thumbnail Image Helper for Yii2
====================================

[](#easy-thumbnail-image-helper-for-yii2)

Yii2 helper for creating and caching thumbnails on real time.

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

[](#installation)

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

- Either run

```
php composer.phar require "porcelanosa/yii2-easy-thumbnail-image-helper" "*"

```

or add

```
"porcelanosa/yii2-easy-thumbnail-image-helper" : "*"
```

to the require section of your application's `composer.json` file.

- Add a new component in `components` section of your application's configuration file (optional), for example:

```
'components' => [
    'thumbnail' => [
        'class' => 'himiklab\thumbnail\EasyThumbnail',
        'cacheAlias' => 'assets/gallery_thumbnails',
    ],
],
```

and in `bootstrap` section, for example:

```
'bootstrap' => ['log', 'thumbnail'],
```

It is necessary if you want to set global helper's settings for the application.

Usage
-----

[](#usage)

For example:

```
use porcelanosa\thumbnail\EasyThumbnailImage;

echo EasyThumbnailImage::thumbnailImg(
    $model->pictureFile,
    50,
    50,
    EasyThumbnailImage::THUMBNAIL_OUTBOUND,
    ['alt' => $model->pictureName]
);
```

For other functions please see the source code.

If you want to handle errors that appear while converting to thumbnail by yourself, please make your own class and inherit it from EasyThumbnailImage. In your class replace only protected method errorHandler. For example

```
class ThumbHelper extends \porcelanosa\thumbnail\EasyThumbnailImage
{

    protected static function errorHandler($error, $filename)
    {
        if ($error instanceof \porcelanosa\thumbnail\FileNotFoundException) {
            return \yii\helpers\Html::img('@web/images/notfound.png');
        } else {
            $filename = basename($filename);
            return \yii\helpers\Html::a($filename,"@web/files/$filename");
        }
    }
}
```

###  Health Score

28

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~684 days

Total

4

Last Release

2140d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e29ecf9bce5c9dd15cb8cd490e0528d6b72d1e97443aacfa50461a93d4498cf7?d=identicon)[porcelanosa](/maintainers/porcelanosa)

---

Top Contributors

[![himiklab](https://avatars.githubusercontent.com/u/6266409?v=4)](https://github.com/himiklab "himiklab (7 commits)")[![porcelanosa](https://avatars.githubusercontent.com/u/518981?v=4)](https://github.com/porcelanosa "porcelanosa (7 commits)")[![vkabachenko](https://avatars.githubusercontent.com/u/9642019?v=4)](https://github.com/vkabachenko "vkabachenko (1 commits)")

---

Tags

thumbnailhelperimageyii2

### Embed Badge

![Health badge](/badges/porcelanosa-yii2-easy-thumbnail-image-helper/health.svg)

```
[![Health](https://phpackages.com/badges/porcelanosa-yii2-easy-thumbnail-image-helper/health.svg)](https://phpackages.com/packages/porcelanosa-yii2-easy-thumbnail-image-helper)
```

PHPackages © 2026

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