PHPackages                             pendalf89/yii2-image-resizer - 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. pendalf89/yii2-image-resizer

ActiveLibrary

pendalf89/yii2-image-resizer
============================

Yii2 image resizer

35872PHP

Since Feb 4Pushed 8y ago1 watchersCompare

[ Source](https://github.com/PendalF89/yii2-image-resizer)[ Packagist](https://packagist.org/packages/pendalf89/yii2-image-resizer)[ RSS](/packages/pendalf89-yii2-image-resizer/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2 image resizer
==================

[](#yii2-image-resizer)

This Yii2 component provide creation thumbnails from original image. Just add array with sizes and have fun!

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist pendalf89/yii2-image-resizer "*"

```

or add

```
"pendalf89/yii2-image-resizer": "*"

```

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

Configuration:

```
'components' => [
    'imageResizer' => [
        'class'                => 'pendalf89\imageresizer\ImageResizer',
        // directory with images
        'dir'                  => '@runtime/images',
        // image sizes. If 'suffix' not set, than width and height be used for suffix name.
        'sizes'                => [
	   // in this case height will be calculated automatically
           ['width' => 800, 'height' => null, 'suffix' => 'lg'],
	   ['width' => 300, 'height' => 200, 'suffix' => 'md'],
	   [
		'width'                    => 300,
		'height'                   => 100,
		'suffix'                   => 'sm',
		'mode'                     => 'inset',
		'thumbnailBackgroundAlpha' => 0,
		'fixedSize'                => true
	   ],
	   ['width' => 200, 'height' => 50], // without suffix. Not recommended.
        ],
        // handle directory recursively
        'recursively'          => true,
        // enable rewrite thumbs if its already exists
        'enableRewrite'        => true,
        // array|string the driver to use. This can be either a single driver name or an array of driver names.
        // If the latter, the first available driver will be used.
        'driver'               => ['gmagick', 'imagick', 'gd2'],
        // image creation mode.
        'mode'                 => 'inset',
        // enable to delete all images, which sizes not in $this->sizes array
        'deleteNonActualSizes' => false,
        // background transparency to use when creating thumbnails in `ImageInterface::THUMBNAIL_INSET`.
	// If "true", background will be transparent, if "false", will be white color.
	// Note, than jpeg images not support transparent background.
        'bgTransparent' => false,
        // want you to get thumbs of a fixed size or not. Has no effect, if $mode set "outbound".
	// If "true" then thumbs will be the exact same size as in the $sizes array.
	// The background will be filled with white color.
	// Background transparency is controlled by the parameter $bgTransparent.
	// If "false", then thumbs will have a proportional size.
	// If the size of the thumbs larger than the original image,
	// the thumbs will be the size of the original image.
        'fixedSize' => true,
    ],
],
```

Usage
-----

[](#usage)

```
// resize all images.
Yii::$app->imageResizer->resizeAll();
// resize one image.
Yii::$app->imageResizer->resize('path/to/original/image.png');
// returns thumbs filenames from original image.
Yii::$app->imageResizer->getThumbs('path/to/original/image.png');
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d4a4b4764a0393c51349746c05db96397f17cce78fa5c025609aa1bb3489eea?d=identicon)[PendalF89](/maintainers/PendalF89)

---

Top Contributors

[![PendalF89](https://avatars.githubusercontent.com/u/5278851?v=4)](https://github.com/PendalF89 "PendalF89 (27 commits)")

### Embed Badge

![Health badge](/badges/pendalf89-yii2-image-resizer/health.svg)

```
[![Health](https://phpackages.com/badges/pendalf89-yii2-image-resizer/health.svg)](https://phpackages.com/packages/pendalf89-yii2-image-resizer)
```

PHPackages © 2026

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