PHPackages                             alex-bond/yii2-thumbler - 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. alex-bond/yii2-thumbler

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

alex-bond/yii2-thumbler
=======================

Library for auto-creating thumbs of images

1.2.0(9y ago)112.1k4BSD-3-ClausePHPPHP &gt;=5.4.0

Since Apr 30Pushed 9y ago2 watchersCompare

[ Source](https://github.com/Alex-Bond/yii2-thumbler)[ Packagist](https://packagist.org/packages/alex-bond/yii2-thumbler)[ RSS](/packages/alex-bond-yii2-thumbler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (6)Used By (0)

[![Gitter Chat](https://camo.githubusercontent.com/181b9ce285cf43406636258ccb695548cb3de0695762a9ee9b4a21f93d616c38/687474703a2f2f696d672e736869656c64732e696f2f62616467652f636861742d6f6e6c696e652d627269676874677265656e2e737667)](https://gitter.im/yiisoft/yii2/rus?utm_source=share-link&utm_medium=link&utm_campaign=share-link)

Image Resizer with automatic cache for Yii 2
============================================

[](#image-resizer-with-automatic-cache-for-yii-2)

This extension allows to resize images and automatically cache them.

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist alex-bond/yii2-thumbler

```

or add

```
"alex-bond/yii2-thumbler": "*"
```

to the require section of your composer.json.

Usage
-----

[](#usage)

To use this extension, you need add the following code in your application configuration:

```
return [
    //....
    'components' => [
        'thumbler'=> [
            'class' => 'alexBond\thumbler\Thumbler',
            'sourcePath' => '/path/to/source/files',
            'thumbsPath' => '/path/to/resize/cache',
        ],
    ],
];
```

After this just call `resize()` method like this:

```
$path = \Yii::$app->thumbler->resize('image.png',500,500);
```

As result of this call extension will return path to resized image relative to `$thumbsPath`.

Methods
-------

[](#methods)

***resize($image, $width, $height, $method = Thumbler::METHOD\_NOT\_BOXED, $backgroundColor = 'ffffff', $callExceptionOnError = true)***

  ParameterDescriptionPossible Values   $imagePath to image based relative to $sourcePathString   $widthWidth of needed image in pixelsint   $heightHeight of needed image in pixelsint   $methodResize algorithm  Thumbler::METHOD\_BOXED; Thumbler::METHOD\_NOT\_BOXED; Thumbler::METHOD\_CROP\_TOP\_LEFT; Thumbler::METHOD\_CROP\_TOP\_CENTER; Thumbler::METHOD\_CROP\_TOP\_RIGHT; Thumbler::METHOD\_CROP\_MIDDLE\_LEFT; Thumbler::METHOD\_CROP\_CENTER; Thumbler::METHOD\_CROP\_MIDDLE\_RIGHT; Thumbler::METHOD\_CROP\_BOTTOM\_LEFT; Thumbler::METHOD\_CROP\_BOTTOM\_CENTER; Thumbler::METHOD\_CROP\_BOTTOM\_RIGHT;    $backgroundColorBackground color for `Thumbler::METHOD\_BOXED` algorithmString (HEX color)   $callExceptionOnErrorWhen `true` extension will caught exception on error. If `false` extension will just add error in internal array which can be called by `getLastError()`boolean ***getLastError()***

Returns last error description.

***clearImageCache($image)***

Clears all cache for selected image file.

***clearAllCache()***

Clears all cache.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 93.8% 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 ~126 days

Total

5

Last Release

3533d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2aa581f95dcb2a157e5cfbb4090e73540989fcfdf400f9820dcbe817f5e9a7c0?d=identicon)[Alex-Bond](/maintainers/Alex-Bond)

---

Top Contributors

[![Alex-Bond](https://avatars.githubusercontent.com/u/1134715?v=4)](https://github.com/Alex-Bond "Alex-Bond (15 commits)")[![ZAYEC77](https://avatars.githubusercontent.com/u/4509483?v=4)](https://github.com/ZAYEC77 "ZAYEC77 (1 commits)")

---

Tags

imageyii2thumbzebra

### Embed Badge

![Health badge](/badges/alex-bond-yii2-thumbler/health.svg)

```
[![Health](https://phpackages.com/badges/alex-bond-yii2-thumbler/health.svg)](https://phpackages.com/packages/alex-bond-yii2-thumbler)
```

###  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)

PHPackages © 2026

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