PHPackages                             andrewdanilov/yii2-thumbs - 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. andrewdanilov/yii2-thumbs

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

andrewdanilov/yii2-thumbs
=========================

Image resize and cache

1.1.0(2y ago)31091MITPHPPHP &gt;=5.6.0

Since Apr 16Pushed 2y ago1 watchersCompare

[ Source](https://github.com/AndrewDanilov/thumbs)[ Packagist](https://packagist.org/packages/andrewdanilov/yii2-thumbs)[ RSS](/packages/andrewdanilov-yii2-thumbs/feed)WikiDiscussions master Synced yesterday

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

Resize and cache image widget
=============================

[](#resize-and-cache-image-widget)

Provides widget class for resizing and caching images

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

[](#installation)

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

Either run

```
composer require andrewdanilov/yii2-thumbs "~1.1.0"

```

or add

```
"andrewdanilov/yii2-thumbs": "~1.1.0"

```

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

Usage
-----

[](#usage)

```
$src = \andrewdanilov\thumbs\Thumb::widget([
    'image' => '/images/img.png', // Image to resize and cache relative to base site uri
    'sizes' => '100x100', // Optional. Result image sizes. String devided with 'x' or array with 'width' and 'height' keys. Default is '100x100'
    'zc' => true, // Optional. Zoom and crop. Default is true.
    'quality' => 90, // Optional. Jpeg quality from 1 to 100. Default is 90
    'backgroundColor' => 'transparent', // Optional. Values like 'transparent', 'FFF', '000000'. Default is 'transparent'
    'noImageUri' => '/images/noimg.png', // Optional. Path to image to use for empty or absent images relative to base site uri
    'cachePath' => '/assets/thumbs/', // Optional. Path to store cached images relative to base site uri. Default is '/assets/thumbs/'
    'cacheTime' => 604800, // Optional. Time to chache in seconds. Default is 604800
]);
echo \yii\helpers\Html::img($src);
```

In the `sizes` parameter, you can specify one or both of the width and height parameters. You can describe this in string notation with the 'x' delimiter, or in array notation with the keys `width` and `height`:

```
// width x height string notation
$sizes = '400x200';
$sizes = '400x';
$sizes = 'x200';
// array notation
$sizes = ['width' => 400, 'height' => 200];
$sizes = ['width' => 400];
$sizes = ['height' => 200];
```

If both sizes are specified, then depending on the value of the `zc` parameter, the resulting image will be cropped (`zc = true`) or padded (`zc = false`) with fields with the color specified in the `backgroundColor` parameter.

The URI in the `noImageUri` parameter must exist. If you don't have it, you can copy it from `/vendor/andrewdanilov/yii2-thumbs/src/web/images/noimage.png` to your location.

If the path from the `cachePath` parameter does not exist, it will be created.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

Total

5

Last Release

1057d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

resizecacheimagesyii2extensionthumbs

### Embed Badge

![Health badge](/badges/andrewdanilov-yii2-thumbs/health.svg)

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

###  Alternatives

[antennaio/laravel-clyde

Image uploads and manipulation for Laravel, a wrapper around Glide

292.6k](/packages/antennaio-laravel-clyde)[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)
