PHPackages                             cubic/wn-imageresizer-plugin - 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. cubic/wn-imageresizer-plugin

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

cubic/wn-imageresizer-plugin
============================

Winter CMS Plugin to resize and compress images.

v1.5.0(3y ago)09MITPHP

Since Sep 30Pushed 3y agoCompare

[ Source](https://github.com/cubicltd/wn-imageresizer-plugin)[ Packagist](https://packagist.org/packages/cubic/wn-imageresizer-plugin)[ RSS](/packages/cubic-wn-imageresizer-plugin/feed)WikiDiscussions develop Synced 1mo ago

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

Image Resizer
=============

[](#image-resizer)

- [Introduction](#introduction)
- [Available filters](#filters)
- [Using a string](#string)
- [Using a variable](#variable)
- [resize()](#resize)
- [imageWidth() - imageHeight()](#imageDimensions)
- [Image Compression](#compression)

Introduction
------------

[](#introduction)

Resizes an image to the required dimensions. It accepts a string with a file path to the image or a `Winter\Storm\Database\Attach\File` object (you will have one of these if you have used the attachOne or AttachMany relationship)

Please note, the not found image can be overwritten via the settings in the admin area.

Available filters
-----------------

[](#available-filters)

[`resize(int $width [, int $height , array $options])`](#resize), [`imageWidth()`](#imageDimensions), [`imageHeight()`](#imageDimensions)

### Using a string

[](#using-a-string)

Please note, if the filter alters the URL, you must apply resize afterwards

```
{{ 'assets/graphics/background.jpg' | theme | resize(500,500) }}

```

### Using a variable

[](#using-a-variable)

```
{{ property.image | resize(500) }}

```

resize(int $width \[, int $height , array $options\])
-----------------------------------------------------

[](#resizeint-width--int-height--array-options)

Resize an image according to the given params. If `$width` or `$height` is `0`, that value is calculated using original image ratio

### Options

[](#options)

KeyDescriptionDefaultOptionsmodeHow the image should be fitted to dimensionsautoexact, portrait, landscape, auto, fit or cropoffsetOffset the resized image\[0,0\]\[int, int\]extensionThe extension on the image to returnautoauto, jpg, jpeg, gif, pngqualityThe quality of compression *\*requires cache clear*950-100sharpenSharpen the image across a scale of 0 - 100 *\*requires cache clear*00-100compressWhether the image should be compressed or not. Only takes effect when TinyPng compression is enabled.truetrue,false### Usage in template

[](#usage-in-template)

```
{{ property.image | resize(500, false, { mode: 'crop', quality: '80', extension: 'png' }) }}

```

### Usage in PHP

[](#usage-in-php)

The image resizer can also be used easily in PHP, as follows:

```
use Cubic\ImageResizer\Classes\Image;

$image = new Image('/path/to/image.jpg');
$image->resize(150, 200, [ 'mode' => 'crop' ]);

```

### Usage in Backend List

[](#usage-in-backend-list)

The image resizer can also be used on backend lists with the type of `thumb`, e.g.

```
image:
    label: Image
    type: thumb

```

This works with:

- AttachMany (uses first image) [Docs](https://octobercms.com/docs/backend/forms#widget-fileupload)
- AttachOne [Docs](https://octobercms.com/docs/backend/forms#widget-fileupload)
- Mediafinder [Docs](https://octobercms.com/docs/backend/forms#widget-mediafinder)

You can also optionally pass width (default 50), height (default 50) and options as follows:

```
image:
    label: Image
    type: thumb
    width: 75
    height: 100
    options:
        mode: crop

```

imageWidth() - imageHeight()
----------------------------

[](#imagewidth---imageheight)

Return current image width/height - useful if you need to know the size of an image resized only by one side.

```
{{ '/path/to/image.jpg' | resize(250) | imageHeight() }}

```

Image Compression via TinyPNG
-----------------------------

[](#image-compression-via-tinypng)

The plugin integrates with the TinyPNG API to provide image compression. A developer API key is required, to obtain one visit . Once obtained, enter it in the Image Resizer Settings area of October CMS backend.

TinyPNG offer 500 free compression per month, the plugin automatically caches resized images to save credits, an option to not compress certain images is also available.

If you are focussed on pagespeed, it is recommended to set your image quality at 70-80 to obtain the lowest filesize whilst still retaining high quality images.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

3

Last Release

1180d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/43a84ef8a314b5d13325afedcd1ad395cf7500505e4cf0d624fba65b9b737431?d=identicon)[matteotrubini](/maintainers/matteotrubini)

---

Top Contributors

[![matt-pawley](https://avatars.githubusercontent.com/u/17622801?v=4)](https://github.com/matt-pawley "matt-pawley (30 commits)")[![matteotrubini](https://avatars.githubusercontent.com/u/7964032?v=4)](https://github.com/matteotrubini "matteotrubini (18 commits)")[![mattpawley](https://avatars.githubusercontent.com/u/4113253?v=4)](https://github.com/mattpawley "mattpawley (14 commits)")[![gergo85](https://avatars.githubusercontent.com/u/2959112?v=4)](https://github.com/gergo85 "gergo85 (12 commits)")[![LukeTowers](https://avatars.githubusercontent.com/u/7253840?v=4)](https://github.com/LukeTowers "LukeTowers (3 commits)")[![chocolata](https://avatars.githubusercontent.com/u/3584586?v=4)](https://github.com/chocolata "chocolata (3 commits)")[![everyx](https://avatars.githubusercontent.com/u/1665522?v=4)](https://github.com/everyx "everyx (2 commits)")[![mauserrifle](https://avatars.githubusercontent.com/u/1580250?v=4)](https://github.com/mauserrifle "mauserrifle (2 commits)")[![DieterHolvoet](https://avatars.githubusercontent.com/u/3606531?v=4)](https://github.com/DieterHolvoet "DieterHolvoet (2 commits)")[![FelixINX](https://avatars.githubusercontent.com/u/8009156?v=4)](https://github.com/FelixINX "FelixINX (2 commits)")[![yapsr](https://avatars.githubusercontent.com/u/3018553?v=4)](https://github.com/yapsr "yapsr (1 commits)")[![cx-emerge](https://avatars.githubusercontent.com/u/3308685?v=4)](https://github.com/cx-emerge "cx-emerge (1 commits)")[![linkapiotr](https://avatars.githubusercontent.com/u/35471762?v=4)](https://github.com/linkapiotr "linkapiotr (1 commits)")[![lthurston](https://avatars.githubusercontent.com/u/202726?v=4)](https://github.com/lthurston "lthurston (1 commits)")[![multiwebinc](https://avatars.githubusercontent.com/u/901732?v=4)](https://github.com/multiwebinc "multiwebinc (1 commits)")[![alxy](https://avatars.githubusercontent.com/u/2057062?v=4)](https://github.com/alxy "alxy (1 commits)")

### Embed Badge

![Health badge](/badges/cubic-wn-imageresizer-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/cubic-wn-imageresizer-plugin/health.svg)](https://phpackages.com/packages/cubic-wn-imageresizer-plugin)
```

###  Alternatives

[mindkomm/timmy

Advanced image manipulation for Timber.

17735.6k](/packages/mindkomm-timmy)[spacecatninja/imager-x

Ninja powered image transforms.

29390.0k23](/packages/spacecatninja-imager-x)[toinekamps/responsive-pics

Responsive Pics is a Wordpress tool for resizing images on the fly.

831.2k](/packages/toinekamps-responsive-pics)[asgardcms/media-module

Media module for AsgardCMS. Handles the media library.

1130.6k2](/packages/asgardcms-media-module)[globalis/wp-cubi-imagemin

Standalone image minification WordPress plugin

1317.7k1](/packages/globalis-wp-cubi-imagemin)[samwilson/diagrams

MediaWiki extension to display various types of diagrams rendered from text within wiki pages.

122.3k](/packages/samwilson-diagrams)

PHPackages © 2026

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