PHPackages                             1-more-thing/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. 1-more-thing/yii2-easy-thumbnail-image-helper

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

1-more-thing/yii2-easy-thumbnail-image-helper
=============================================

Yii2 helper for creating and caching thumbnails on real time

1.1(3y ago)06MITPHP

Since Mar 31Pushed 3y agoCompare

[ Source](https://github.com/1-more-thing/yii2-easy-thumbnail-image-helper)[ Packagist](https://packagist.org/packages/1-more-thing/yii2-easy-thumbnail-image-helper)[ RSS](/packages/1-more-thing-yii2-easy-thumbnail-image-helper/feed)WikiDiscussions master Synced 1mo ago

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

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

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

![Packagist](https://camo.githubusercontent.com/fafd0f9d548eb8832f5e912c101a4345d4a5418470e9fcdea0462ff2558c74c2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68696d696b6c61622f796969322d656173792d7468756d626e61696c2d696d6167652d68656c7065722e737667) ![Packagist](https://camo.githubusercontent.com/df06e27ec1ea51383fa03dbb1eda3d61a92ea9b650184041db15f20603f46532/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68696d696b6c61622f796969322d656173792d7468756d626e61696c2d696d6167652d68656c7065722e737667) ![license](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)

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 "himiklab/yii2-easy-thumbnail-image-helper" "*"

```

or add

```
"himiklab/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, 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 himiklab\thumbnail\EasyThumbnailImage;

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

or

```
use himiklab\thumbnail\EasyThumbnailImage;

echo EasyThumbnailImage::thumbnailImg(
    'http://...',
    50,
    50,
    EasyThumbnailImage::THUMBNAIL_OUTBOUND,
);
```

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 \himiklab\thumbnail\EasyThumbnailImage
{

    protected static function errorHandler($error, $filename)
    {
        if ($error instanceof \himiklab\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

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.1% 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 ~0 days

Total

2

Last Release

1138d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/931b97c20b43bcc827fdd420fda3cca79f6758a6768e2e4ab54d6ff86922d358?d=identicon)[airmoi](/maintainers/airmoi)

---

Top Contributors

[![himiklab](https://avatars.githubusercontent.com/u/6266409?v=4)](https://github.com/himiklab "himiklab (25 commits)")[![airmoi](https://avatars.githubusercontent.com/u/2822333?v=4)](https://github.com/airmoi "airmoi (3 commits)")[![worstinme](https://avatars.githubusercontent.com/u/2964518?v=4)](https://github.com/worstinme "worstinme (3 commits)")[![vkabachenko](https://avatars.githubusercontent.com/u/9642019?v=4)](https://github.com/vkabachenko "vkabachenko (1 commits)")

---

Tags

thumbnailhelperimageyii2

### Embed Badge

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

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

PHPackages © 2026

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