PHPackages                             joacub/webino-image-thumb - 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. [Framework](/categories/framework)
4. /
5. joacub/webino-image-thumb

ActiveLibrary[Framework](/categories/framework)

joacub/webino-image-thumb
=========================

Image Thumbnailer for Zend Framework 2

1.0.0(13y ago)025New BSD LicensePHPPHP &gt;=5.3.3

Since Nov 3Pushed 9y ago1 watchersCompare

[ Source](https://github.com/joacub/WebinoImageThumb)[ Packagist](https://packagist.org/packages/joacub/webino-image-thumb)[ Docs](https://github.com/webino/WebinoImageThumb)[ RSS](/packages/joacub-webino-image-thumb/feed)WikiDiscussions develop Synced 2mo ago

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

Image Thumbnailer
 for Zend Framework 2
========================================

[](#image-thumbnailer--for-zend-framework-2)

[![Build Status](https://camo.githubusercontent.com/cf32706187e891ba0003502e4a11eb6e63658a4a239dbe87c2b55451cec2e934/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f776562696e6f2f576562696e6f496d6167655468756d622e706e673f6272616e63683d646576656c6f70)](http://travis-ci.org/webino/WebinoImageThumb "Develop Build Status")[![Coverage Status](https://camo.githubusercontent.com/82ebf0101a6847b6412333a6d02895c80562aa181e82b8c39626652f7888e80c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f776562696e6f2f576562696e6f496d6167655468756d622f62616467652e706e673f6272616e63683d646576656c6f70)](https://coveralls.io/r/webino/WebinoImageThumb?branch=develop "Develop Coverage Status")[![Scrutinizer Quality Score](https://camo.githubusercontent.com/68902569c02f7c9ffef1b5545d254599368941e5eeaff717ab9c953083dfc9de/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f776562696e6f2f576562696e6f496d6167655468756d622f6261646765732f7175616c6974792d73636f72652e706e673f733d62336566363239653765386561616665316464386437303132383935386332373138646438353739)](https://scrutinizer-ci.com/g/webino/WebinoImageThumb/ "Quality Score")[![Dependency Status](https://camo.githubusercontent.com/f41588850adb364439b1c1472f7015ef910b9ca699036317d442c096171a66dd/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3532396639373234363332626163353733313030303062362f62616467652e706e67)](https://www.versioneye.com/user/projects/529f9724632bac57310000b6 "Develop Dependency Status")
[![Latest Stable Version](https://camo.githubusercontent.com/7596367b2572bbd04c4973e0cc9a9caa2f4c9231d796ebee6760ab8d4fdac715/68747470733a2f2f706f7365722e707567782e6f72672f776562696e6f2f776562696e6f2d696d6167652d7468756d622f762f737461626c652e706e67)](https://packagist.org/packages/webino/webino-image-thumb "Latest Stable Version")[![Total Downloads](https://camo.githubusercontent.com/d375e36b97c8b62a0b40df23f76799e1df6907a3a5860f152d162315ad6a6a26/68747470733a2f2f706f7365722e707567782e6f72672f776562696e6f2f776562696e6f2d696d6167652d7468756d622f646f776e6c6f6164732e706e67)](https://packagist.org/packages/webino/webino-image-thumb "Total Downloads")[![Latest Unstable Version](https://camo.githubusercontent.com/632acef4d4c181e11fedcc3e39a31e6d550f58914c517968ef0059b342445735/68747470733a2f2f706f7365722e707567782e6f72672f776562696e6f2f776562696e6f2d696d6167652d7468756d622f762f756e737461626c652e706e67)](https://packagist.org/packages/webino/webino-image-thumb "Latest Unstable Version")[![License](https://camo.githubusercontent.com/0070b860c452ad533c1e8aa9cc6af07bc87ca5facbc4318ab4c6f5ffd3ef8802/68747470733a2f2f706f7365722e707567782e6f72672f776562696e6f2f776562696e6f2d696d6167652d7468756d622f6c6963656e73652e737667)](https://packagist.org/packages/webino/webino-image-thumb)

Service that provides API to manipulate images.

- Powered by [PHPThumb](https://github.com/masterexploder/PHPThumb)
- Demo [webino-image-thumb.demo.webino.org](http://webino-image-thumb.demo.webino.org/)
    - [Reflection](http://webino-image-thumb.demo.webino.org/application/demo/reflection)
    - [Whitespace cropper](http://webino-image-thumb.demo.webino.org/application/demo/whitespace-cropper)
    - [Sharpen](http://webino-image-thumb.demo.webino.org/application/demo/sharpen)
    - [Watermark](http://webino-image-thumb.demo.webino.org/application/demo/watermark)

Features
--------

[](#features)

- Resize, crop, pad, rotate, show and save images
- Create image reflection
- Crop whitespace
- Sharpen images
- Watermark

Setup
-----

[](#setup)

Following steps are necessary to get this module working, considering a zf2-skeleton or very similar application:

1. Run: `php composer.phar require webino/webino-image-thumb:dev-develop`
2. Add `WebinoImageThumb` to the enabled modules list

Requirements
------------

[](#requirements)

- GD 2.0+

QuickStart
----------

[](#quickstart)

- For example add following code into the controller action, assume example image:

    ```
    // We encourage to use Dependency Injection instead of Service Locator
    $thumbnailer = $this->getServiceLocator()->get('WebinoImageThumb');
    $imagePath   = 'public/images/example.jpg';
    $thumb       = $thumbnailer->create($imagePath, $options = [], $plugins = []);

    $thumb->resize(100, 100);

    $thumb->show();
    // or/and
    $thumb->save('public/images/resized.jpg');

    ```

    *NOTE: If you don't know how to inject the WebinoImageThumb into action controller, check out `test/resources`*
- Use reflection plugin:

    ```
    $reflection = $thumbnailer->createReflection(40, 40, 80, true, '#a4a4a4');
    $thumb      = $thumbnailer->create($imagePath, [], [$reflection]);

    ```
- Use whitespace cropper plugin:

    ```
    $cropper = $thumbnailer->createWhitespaceCropper();
    $thumb   = $thumbnailer->create($imagePath, [], [$cropper]);

    ```
- Use sharpen plugin:

    ```
    $sharpen = $thumbnailer->createSharpen();
    $thumb   = $thumbnailer->create($imagePath, [], [$sharpen]);

    ```
- Use watermark plugin:

    ```
    $watermarkPath  = 'public/images/my_watermark.png';
    $watermarkThumb = $thumbnailer->create($watermarkPath);
    $watermark      = $thumbnailer->createWatermark($watermarkThumb);
    $thumb          = $thumbnailer->create($imagePath, [], [$watermark]);

    ```

Options
-------

[](#options)

The options array allows you to customize the behavior of the library a bit. Some of these options are implementation-specific, and are noted as such. So, let's first go over what options are available to us:

  Option Name Description Default Value Valid Values   resizeUp Whether or not to scale an image up to the desired dimensions false true / false   jpegQuality What quality to save jpeg files with (how much compression to use, 100 being none) 100 1-100   correctPermissions Whether or not the library should attempt to correct file permissions. This will only work if you set up your PHP to allow chmod operations false true / false   preserveAlpha Whether or not to preserve alpha transparency in PNG files true true / false   alphaMaskColor What rgb color should be used for the alpha mask `[255, 255, 255]` `[0-255, 0-255, 0-255]`   preserveTransparency Whether or not to preserve transparency in GIF files true true / false   transparencyMaskColor What rgb color should be used for the transparency mask `[255, 255, 255]` `[0-255, 0-255, 0-255]`   interlace When the interlace option equals true or false call imageinterlace `null` `true / false` Functions
---------

[](#functions)

- `adaptiveResize($width, $height)`
- `adaptiveResizePercent($width, $height, $percent = 50)`
- `adaptiveResizeQuadrant($width, $height, $quadrant = 'T|B|C|L|R')`
- `crop($startX, $startY, $cropWidth, $cropHeight)`
- `cropFromCenter($cropWidth, $cropHeight = null)`
- `pad($width, $height, $color = [255, 255, 255])`
- `resize($maxWidth, $maxHeight)`
- `resizePercent($percent)`
- `rotateImage($direction = 'CW|CCW')`
- `rotateImageNDegrees($degrees)`
- `save($fileName, $format = 'GIF|JPG|PNG')`
- `show($rawData = false)`

Getters / Setters
-----------------

[](#getters--setters)

- `getCurrentDimensions()`
- `getFileName()`
- `getFormat()`
- `getIsRemoteImage()`
- `getMaxHeight()`
- `getMaxWidth()`
- `getNewDimensions()`
- `getOldImage()`
- `getOptions()`
- `getPercent()`
- `getWorkingImage()`
- `setCurrentDimensions($currentDimensions)`
- `setFileName($fileName)`
- `setFormat($format)`
- `setMaxHeight($maxHeight)`
- `setMaxWidth($maxWidth)`
- `setNewDimensions($newDimensions)`
- `setOldImage($oldImage)`
- `setOptions($options)`
- `setPercent($percent)`
- `setWorkingImage($workingImage)`

Reflection plugin
-----------------

[](#reflection-plugin)

- `createReflection($percent, $reflection, $white, $border, $borderColor)`

    - `$percent` - What percentage of the image to create the reflection from.
    - `$reflection` - What percentage of the image height should the reflection height be.
    - `$white` - How transparent (using white as the background) the reflection should be, as a percent.
    - `$border` - Whether a border should be drawn around the original image.
    - `$borderColor` - The hex value of the color you would like your border to be.

Whitespace Cropper plugin
-------------------------

[](#whitespace-cropper-plugin)

- `createWhitespaceCropper($border, $color)`

    - `$margin` - What pixels of a margin should be around the original image.
    - `$color` - The hex value of the color you would like to crop.

Watermark plugin
----------------

[](#watermark-plugin)

- `createWatermark(PHPThumb $watermarkThumb, $position = [0, 0], $scale = .5)`

    - `$watermarkThumb` - Watermark image from watermark file.
    - `$position` - Position of watermark, center by default:
        - `[0, 0]` - center
        - `[-1, -1]` - left bottom
        - `[-1, 1]` - left top
        - `[1, 1]` - right top
        - `[1, -1]` - right bottom
    - `$scale` - Scale of the watermark relative to the image.

Changelog
---------

[](#changelog)

### 2.0.0 \[UNRELEASED\]

[](#200-unreleased)

- Requires PHPThumb 2.0 via composer
- Added Whitespace Cropper plugin
- Added Sharpen plugin
- Removed ZF autoloader support
- Added Watermark plugin
- Added ImageThumbAwareInterface &amp; Trait

### 1.0.0

[](#100)

- Initial release

Development
-----------

[](#development)

[![Dependency Status](https://camo.githubusercontent.com/434114161dbac3080e5b0cdab5ea0bb3e5848e637e0926e0dd208cd936a5d9ed/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3532663439346632656331333735646337623030303063642f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/52f494f2ec1375dc7b0000cd)

We will appreciate any contributions on development of this module.

Learn [How to develop Webino modules](https://github.com/webino/Webino/wiki/How-to-develop-Webino-module)

Addendum
--------

[](#addendum)

Most of the documentation is taken from the [PHPThumb wiki](https://github.com/masterexploder/PHPThumb/wiki).

Please, if you are interested in this Zend Framework module report any issues and don't hesitate to contribute.

[Report a bug](https://github.com/webino/WebinoImageThumb/issues) | [Fork me](https://github.com/webino/WebinoImageThumb)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.5% 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 ~396 days

Total

2

Last Release

4542d ago

Major Versions

1.0.0 → 2.0.0-RC12013-12-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c5ea80353eb117dbabb0def7d2a43079815acee0d55f690a6476c03e458c203?d=identicon)[joacub](/maintainers/joacub)

---

Top Contributors

[![bacinsky](https://avatars.githubusercontent.com/u/3078875?v=4)](https://github.com/bacinsky "bacinsky (77 commits)")[![ceadreak](https://avatars.githubusercontent.com/u/6448960?v=4)](https://github.com/ceadreak "ceadreak (1 commits)")[![joacub](https://avatars.githubusercontent.com/u/2091228?v=4)](https://github.com/joacub "joacub (1 commits)")

---

Tags

frameworkimagezendzf2thumbwebino

### Embed Badge

![Health badge](/badges/joacub-webino-image-thumb/health.svg)

```
[![Health](https://phpackages.com/badges/joacub-webino-image-thumb/health.svg)](https://phpackages.com/packages/joacub-webino-image-thumb)
```

###  Alternatives

[webino/webino-image-thumb

Image Thumbnailer for Zend Framework 2

4079.0k](/packages/webino-webino-image-thumb)

PHPackages © 2026

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