PHPackages                             daxslab/yii2-thumbnailer - 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. daxslab/yii2-thumbnailer

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

daxslab/yii2-thumbnailer
========================

Yii2 component to generate image thumnails of any size

1.2.0(6y ago)915.8k—0%4[2 PRs](https://github.com/daxslab/yii2-thumbnailer/pulls)1MITPHP

Since Jan 15Pushed 1y ago2 watchersCompare

[ Source](https://github.com/daxslab/yii2-thumbnailer)[ Packagist](https://packagist.org/packages/daxslab/yii2-thumbnailer)[ RSS](/packages/daxslab-yii2-thumbnailer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (10)Used By (1)

Yii2 Thumbnailer
================

[](#yii2-thumbnailer)

[![Build Status](https://camo.githubusercontent.com/5f26f14782a2dbc0a5fe40a51ace659cc953af5d727396e341228a12149915de/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f646178736c61622f796969322d7468756d626e61696c65722e706e67)](http://travis-ci.org/daxslab/yii2-thumbnailer)[![Latest Stable Version](https://camo.githubusercontent.com/6a293fb2a028eb7766bdeeaae06cbb95ab2537e760099dec03a3fb1a5dae0706/68747470733a2f2f706f7365722e707567782e6f72672f646178736c61622f796969322d7468756d626e61696c65722f762f737461626c652e737667)](https://packagist.org/packages/daxslab/yii2-thumbnailer)[![Total Downloads](https://camo.githubusercontent.com/4f30eaef33fc7f1594fca801767c99074781883e872ca9f29fb9f9f21f1f63e5/68747470733a2f2f706f7365722e707567782e6f72672f646178736c61622f796969322d7468756d626e61696c65722f646f776e6c6f616473)](https://packagist.org/packages/daxslab/yii2-thumbnailer)[![Latest Unstable Version](https://camo.githubusercontent.com/f04ce156901d956d78cfaf40bb56f2fb6a59e447f88308643230d97f11a41c00/68747470733a2f2f706f7365722e707567782e6f72672f646178736c61622f796969322d7468756d626e61696c65722f762f756e737461626c652e737667)](https://packagist.org/packages/daxslab/yii2-thumbnailer)[![License](https://camo.githubusercontent.com/0102eb302c08956fa2820343814e83e55a28f507cc342823e0cf61d6e6f0a686/68747470733a2f2f706f7365722e707567782e6f72672f646178736c61622f796969322d7468756d626e61696c65722f6c6963656e73652e737667)](https://packagist.org/packages/daxslab/yii2-thumbnailer)

Yii2 component to generate image thumnails of any size.

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist daxslab/yii2-thumbnailer "*"

```

or add

```
"daxslab/yii2-thumbnailer": "*"

```

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

Configuration
-------------

[](#configuration)

The basic configuration only requires adding the component to the application:

```
'components' => [
    //...
    'thumbnailer' => [
        'class' => 'daxslab\thumbnailer\Thumbnailer',
    ],
    //...
]
```

Besides that a default value is always provided, all the options can be configured.

```
'components' => [
    //...
    'thumbnailer' => [
        'class' => 'daxslab\thumbnailer\Thumbnailer',
        'defaultWidth' => 500,
        'defaultHeight' => 500,
        'thumbnailsBasePath' => '@webroot/assets/thumbs',
        'thumbnailsBaseUrl' => '@web/assets/thumbs',
        'enableCaching' => true, //defaults to false but is recommended
    ],
    //...
]
```

Usage
-----

[](#usage)

Once the extension is configured, simply use it in your views by:

```
//Generates thumbnail with default values specified in the configuration
Html::img(Yii::$app->thumbnailer->get($imageUrl));

//Generates a 400px width thumbnail. The height is determined as the width because is not set.
Html::img(Yii::$app->thumbnailer->get($imageUrl, 400));

//Generates a 400x400 pixels thumbnail and 60% quality
Html::img(Yii::$app->thumbnailer->get($imageUrl, 400, 400));

//Generates a 400x400 pixels thumbnail and 10% quality
Html::img(Yii::$app->thumbnailer->get($imageUrl, 400, 400, 10));

//Generates a 400x400 pixels thumbnail, 10% quality and not cropping the image
//but inserting it into a box with the specified dimensions.
Html::img(Yii::$app->thumbnailer->get($imageUrl, 400, 400, 10, ManipulatorInterface::THUMBNAIL_INSET));
```

Proudly made by [Daxslab](http://daxslab.com).

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 57.7% 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 ~96 days

Recently: every ~179 days

Total

9

Last Release

2267d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13596248?v=4)[Gabriel Alejandro López López](/maintainers/glpzzz)[@glpzzz](https://github.com/glpzzz)

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

---

Top Contributors

[![glpzzz](https://avatars.githubusercontent.com/u/13596248?v=4)](https://github.com/glpzzz "glpzzz (15 commits)")[![cccaballero](https://avatars.githubusercontent.com/u/3727802?v=4)](https://github.com/cccaballero "cccaballero (10 commits)")[![oatcpe](https://avatars.githubusercontent.com/u/3403603?v=4)](https://github.com/oatcpe "oatcpe (1 commits)")

---

Tags

thumbnailimageyii2

### Embed Badge

![Health badge](/badges/daxslab-yii2-thumbnailer/health.svg)

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

###  Alternatives

[sadovojav/yii2-image-thumbnail

Yii2 image thumbnail component

2142.1k](/packages/sadovojav-yii2-image-thumbnail)[trntv/yii2-glide

Yii2 Glide Extension

41269.5k9](/packages/trntv-yii2-glide)[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)
