PHPackages                             maximal/yii2-webp-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. maximal/yii2-webp-thumbnailer

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

maximal/yii2-webp-thumbnailer
=============================

Yii2 (over Imagine) helper for creating and caching WebP thumbnails in real time

v1.0.0(5y ago)44481MITPHP

Since May 7Pushed 3y ago1 watchersCompare

[ Source](https://github.com/maximal/yii2-webp-thumbnailer)[ Packagist](https://packagist.org/packages/maximal/yii2-webp-thumbnailer)[ RSS](/packages/maximal-yii2-webp-thumbnailer/feed)WikiDiscussions master Synced today

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

Yii2 thumbnailer with WebP support
==================================

[](#yii2-thumbnailer-with-webp-support)

This is an Yii2 helper over the [PHP WebP thumbnailer](https://github.com/maximal/php-webp-thumbnailer)which allows you to generate and cache image WebP thumbnails in your Yii2 application on the fly.

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

[](#installation)

Install this library with Composer:

```
php composer.phar require "maximal/yii2-webp-thumbnailer" "*"
```

or add

```
"maximal/yii2-webp-thumbnailer": "*"

```

to the `require` section of your app’s `composer.json` file.

Checking the environment
------------------------

[](#checking-the-environment)

You will need WebP coder (`cwebp` command) installed in your system.

For instance in Ubuntu/Debian it is included in `webp` package:

```
sudo apt install webp
```

Check the command:

```
cwebp -version
```

You should get an output with version number (like `0.6.1`).

If you have installed `cwebp` to a different command or path, configure the static property `WebpThumbnailer::$cwebpCommand` before using the helper (see the example below).

More info about WebP:

Generating thumbnails
---------------------

[](#generating-thumbnails)

Use this thumbnailer in your Yii2 application:

```
use maximal\thumbnail\yii\WebpThumbnailer;

echo WebpThumbnailer::picture('@webroot/img/image.png', $width, $height);
```

More options (`outbound` instead of default `inset`; `alt` and `class`attribute added):

```
use maximal\thumbnail\yii\WebpThumbnailer;

echo WebpThumbnailer::picture(
	'@webroot/img/image.png',
	$width,
	$height,
	false,
	['alt' => 'Alt attribute', 'class' => 'img-responsive']
);
```

Custom `cwebp` command:

```
use maximal\thumbnail\yii\WebpThumbnailer;

WebpThumbnailer::$cwebpCommand = '/usr/local/bin/cwebp';
echo WebpThumbnailer::picture('@webroot/img/image.jpg', $width, $height);
```

The helper’s `picture()` method uses modern `` HTML tag as follows:

```

```

Here you have `image/webp` source for [browsers which support WebP images](https://caniuse.com/#search=WebP)and traditional (PNG, JPEG, TIFF, GIF) image fallback.

Author
======

[](#author)

- Websites:  and
- StackOverflow story:
- Twitter:
- Telegram:

###  Health Score

28

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

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

Unknown

Total

1

Last Release

2144d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/980679?v=4)[MaximAL](/maintainers/maximal)[@maximal](https://github.com/maximal)

---

Top Contributors

[![maximal](https://avatars.githubusercontent.com/u/980679?v=4)](https://github.com/maximal "maximal (2 commits)")

---

Tags

thumbnailhelperimageimagineyii2extensionWebp

### Embed Badge

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

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

PHPackages © 2026

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