PHPackages                             mirko-pagliai/cakephp-thumber - 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. mirko-pagliai/cakephp-thumber

AbandonedArchivedCakephp-plugin[Image &amp; Media](/categories/media)

mirko-pagliai/cakephp-thumber
=============================

Thumber plugin for CakePHP

1.12.0(2y ago)772.4k↓100%4MITPHPPHP &gt;=8.1

Since Oct 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mirko-pagliai/cakephp-thumber)[ Packagist](https://packagist.org/packages/mirko-pagliai/cakephp-thumber)[ Docs](https://github.com/mirko-pagliai/cakephp-thumber)[ RSS](/packages/mirko-pagliai-cakephp-thumber/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (50)Used By (0)

cakephp-thumber
===============

[](#cakephp-thumber)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.txt)[![CI](https://github.com/mirko-pagliai/cakephp-thumber/actions/workflows/ci.yml/badge.svg)](https://github.com/mirko-pagliai/cakephp-thumber/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/fb502c74cd3e83b9f5d9504f656bc4e25d64d3202595a37604df8c68f6a07620/68747470733a2f2f636f6465636f762e696f2f67682f6d69726b6f2d7061676c6961692f63616b657068702d7468756d6265722f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/mirko-pagliai/cakephp-thumber)[![Codacy Badge](https://camo.githubusercontent.com/0e8606bbecba4f279758cf75357b165d62975f2abcca3c9e5dd714b75fa48df6/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3862333336633036376361613439646262313434363031383632373935313433)](https://www.codacy.com/gh/mirko-pagliai/cakephp-thumber/dashboard?utm_source=github.com&utm_medium=referral&utm_content=mirko-pagliai/cakephp-thumber&utm_campaign=Badge_Grade)[![CodeFactor](https://camo.githubusercontent.com/0a2aa468720ddf083f6a4a0ab962f87fd299de4def103ca05a9b2f1a7cffd9f2/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f6d69726b6f2d7061676c6961692f63616b657068702d7468756d6265722f6261646765)](https://www.codefactor.io/repository/github/mirko-pagliai/cakephp-thumber)

*cakephp-thumber* is a CakePHP plugin to create thumbnails.

It uses [intervention/image](https://github.com/Intervention/image) and provides:

- `ThumbCreator`, an utility to create thumbnails;
- `ThumbHelper`, a convenient helper that allows you to create thumbnails on the fly from your templates.

Starting from `1.8.0` release, much of the code has been moved into the [php-thumber](https://github.com/mirko-pagliai/php-thumber) package, so that it becomes a php library independent from CakePHP. This plugin continues to exist and all classes and methods remain unchanged, but it only includes the code closely related to CakePHP (commands, helpers, middlewares, etc). The namespace prefix is now `Thumber\Cake` and no longer `Thumber`.

Did you like this plugin? Its development requires a lot of time for me. Please consider the possibility of making [a donation](//paypal.me/mirkopagliai): even a coffee is enough! Thank you.

[![Make a donation](https://camo.githubusercontent.com/d9f2015fc776952b7d14005e3f0e18099924deeb096bffd93869762ebecde952/68747470733a2f2f7777772e70617970616c6f626a656374732e636f6d2f7765627374617469632f6d6b74672f6c6f676f2d63656e7465722f6c6f676f5f70617970616c5f63617274652e6a7067)](//paypal.me/mirkopagliai)

---

- [Requirements and supported formats](#requirements-and-supported-formats)
- [Installation](#installation)
    - [Installation on older CakePHP and PHP versions](#installation-on-older-cakephp-and-php-versions)
        - [For PHP 8.0 and CakePHP 4 or later](#for-php-80-and-cakephp-4-or-later)
        - [For PHP 7.2 or later](#for-php-72-or-later)
        - [For PHP 5.6 and CakePHP 3 or later](#for-php-56-and-cakephp-3-or-later)
- [Configuration](#configuration)
    - [Configuration values](#configuration-values)
- [How to use](#how-to-use)
- [Testing](#testing)
- [Versioning](#versioning)

Requirements and supported formats
----------------------------------

[](#requirements-and-supported-formats)

*cakephp-thumber* requires GD Library (&gt;=2.0) **or** Imagick PHP extension (&gt;=6.5.7). It's **highly preferable** to use Imagick, because It provides better performance and a greater number of supported formats.

Supported formats may vary depending on the library used.

JPEGPNGGIFTIFBMPICOPSDGDYesYesYesNoNoNoNoImagickYesYesYesYesYesYesYesFor more information about supported format, please refer to the [Intervention Image documentation](http://image.intervention.io/getting_started/formats).

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

[](#installation)

You can install the plugin via composer:

```
$ composer require --prefer-dist mirko-pagliai/cakephp-thumber
```

Then you have to load the plugin. For more information on how to load the plugin, please refer to the [Cookbook](//book.cakephp.org/4.0/en/plugins.html#loading-a-plugin).

Simply, you can execute the shell command to enable the plugin:

```
bin/cake plugin load Thumber/Cake
```

This would update your application's bootstrap method.

By default the plugin uses the `APP/tmp/thumbs` directory to save the thumbnails. So you have to create the directory and make it writable:

```
$ mkdir tmp/thumbs && chmod 775 tmp/thumbs
```

If you want to use a different directory, read the [Configuration](#configuration) section.

### Installation on older CakePHP and PHP versions

[](#installation-on-older-cakephp-and-php-versions)

Recent packages and the master branch require at least CakePHP 5.0 and PHP 8.1 and the current development of the code is based on these and later versions of CakePHP and PHP. However, there are still some branches compatible with previous versions of CakePHP and PHP.

#### For PHP 8.0 and CakePHP 4 or later

[](#for-php-80-and-cakephp-4-or-later)

The [cakephp4](//github.com/mirko-pagliai/cakephp-thumber/tree/cakephp4) branch requires at least PHP `>=7.4` and CakePHP `^4.4`.

In this case, you can install the package as well:

```
$ composer require --prefer-dist mirko-pagliai/cakephp-thumber:dev-cakephp4
```

Note that the `cakephp4` branch will no longer be updated as of January 5, 2024, except for security patches, and it matches the [1.11.3](//github.com/mirko-pagliai/cakephp-thumber/releases/tag/1.11.3) version.

#### For PHP 7.2 or later

[](#for-php-72-or-later)

The [php7.2](//github.com/mirko-pagliai/cakephp-thumber/tree/php7.2) branch requires at least PHP 7.2.

In this case, you can install the package as well:

```
$ composer require --prefer-dist mirko-pagliai/cakephp-thumber:dev-php7.2
```

Note that the `php7.2` branch will no longer be updated as of April 29, 2022, except for security patches, and it matches the [1.9.9](https://github.com/mirko-pagliai/cakephp-thumber/releases/tag/1.9.9) version.

#### For PHP 5.6 and CakePHP 3 or later

[](#for-php-56-and-cakephp-3-or-later)

The [cakephp3](//github.com/mirko-pagliai/cakephp-thumber/tree/cakephp3) branch requires at least PHP 5.6 and CakePHP 3.

In this case, you can install the package as well:

```
$ composer require --prefer-dist mirko-pagliai/cakephp-thumber:dev-cakephp3
```

Note that the `cakephp3` branch will no longer be updated as of May 7, 2021, except for security patches, and it matches the [1.9.4](//github.com/mirko-pagliai/cakephp-thumber/releases/tag/1.9.4) version.

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

[](#configuration)

The plugin uses some configuration parameters and you can set them using the `\Cake\Core\Configure` class, **before** loading the plugin.

For example, you can do this at the bottom of the file `APP/config/app.php`of your application.

### Configuration values

[](#configuration-values)

```
Configure::write('Thumber.driver', 'imagick');
```

Setting `Thumber.driver`, you can choose which driver to use for the creation of thumbnails. Valid values are `imagick` or `gd`.

```
Configure::write('Thumber.target', TMP . 'thumbs');
```

Setting `Thumber.target`, you can use another directory where the plugin will save thumbnails.

How to use
----------

[](#how-to-use)

See our wiki:

- [How to use the helper](https://github.com/mirko-pagliai/cakephp-thumber/wiki/How-to-use-the-helper)
- [How to use the ThumbCreator utility](https://github.com/mirko-pagliai/cakephp-thumber/wiki/How-to-use-the-ThumbCreator-utility)

And refer to our [API](//mirko-pagliai.github.io/cakephp-thumber).

Testing
-------

[](#testing)

The library (`GD` or `Imagick`) to be tested is set by the `tests/bootstrap.php` file, using the `THUMBER_DRIVER` environment variable. By default, `Imagick` is used.

For example:

```
if (!getenv('THUMBER_DRIVER')) {
    putenv('THUMBER_DRIVER=imagick');
}

Configure::write('Thumber.driver', getenv('THUMBER_DRIVER'));
```

Moreover, some tests belong to the `imageEquals` group. These tests generate thubnails and compare them with pre-loaded thumbnails (inside `tests/comparing_files/`). By default, these tests are not performed, because the images may be different if generated from different environments and systems.

To exclude these tests, you should run:

```
vendor/bin/phpunit --exclude-group imageEquals
```

Versioning
----------

[](#versioning)

For transparency and insight into our release cycle and to maintain backward compatibility, *Thumber* will be maintained under the [Semantic Versioning guidelines](http://semver.org).

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

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

Recently: every ~74 days

Total

45

Last Release

856d ago

PHP version history (4 changes)1.0.0PHP &gt;=5.5.9

1.9.0PHP &gt;=7.2

1.10.0PHP &gt;=7.4

1.12.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/56d4c91c4d1ce5952a13c723d4fd340f8a1220ba1ef0212bbdb9a6334c98b3b9?d=identicon)[mirko-pagliai](/maintainers/mirko-pagliai)

---

Top Contributors

[![mirko-pagliai](https://avatars.githubusercontent.com/u/293199?v=4)](https://github.com/mirko-pagliai "mirko-pagliai (637 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mirko-pagliai-cakephp-thumber/health.svg)

```
[![Health](https://phpackages.com/badges/mirko-pagliai-cakephp-thumber/health.svg)](https://phpackages.com/packages/mirko-pagliai-cakephp-thumber)
```

###  Alternatives

[league/glide

Wonderfully easy on-demand image manipulation library with an HTTP based API.

2.6k51.2M116](/packages/league-glide)[jenssegers/imagehash

Perceptual image hashing for PHP

2.1k2.2M5](/packages/jenssegers-imagehash)[intervention/image-laravel

Laravel Integration of Intervention Image

1496.5M101](/packages/intervention-image-laravel)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[lasserafn/php-initial-avatar-generator

A package to generate avatars with initials for PHP

4374.2M13](/packages/lasserafn-php-initial-avatar-generator)[ctessier/nova-advanced-image-field

An advanced image field for Nova with cropping and resizing.

103548.4k1](/packages/ctessier-nova-advanced-image-field)

PHPackages © 2026

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