PHPackages                             mercator/wn-media-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. mercator/wn-media-plugin

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

mercator/wn-media-plugin
========================

Media Processing Plugin for Winter CMS, replacing resize and introducing advanced image filter capabilities based on the Intervention library.

01.0kPHP

Since Sep 20Pushed 7mo agoCompare

[ Source](https://github.com/helmutkaufmann/wn-media-plugin)[ Packagist](https://packagist.org/packages/mercator/wn-media-plugin)[ RSS](/packages/mercator-wn-media-plugin/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Winter CMS Media Plugin
=======================

[](#winter-cms-media-plugin)

Improved media handling for [WinterCMS](https://wintercms.com), including:

- Winter CMS image resizer replacement: Rendering modern image formats where they can be displayed by the browsers.
- Advanced image manipulation using the [Intervention](http://image.intervention.io) library.

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

[](#installation)

#### composer

[](#composer)

```
composer require mercator/wn-twigext-plugin "^3.0"
php artisan winter:up

```

#### github

[](#github)

```
git clone git@github.com:helmutkaufmann/wn-media-plugin.git

```

Twig Filters
------------

[](#twig-filters)

### iresize(\[width=null\], \[height=null\], \[filters=null\], \[extension=null\], \[quality=null\])

[](#iresizewidthnull-heightnull-filtersnull-extensionnull-qualitynull)

or

### ifilter(\[width=null\], \[height=null\], \[filters\], \[extension\], \[quality\])

[](#ifilterwidthnull-heightnull-filters-extension-quality)

These are identical filters to resize images and apply filters to them.

If *width* and *height* are specified, the image is resized **before** applying any *filters*. This significantly boosts performance.

To keep the aspect ration of an image, set **either** *width* or *height* to *zero (0)*.

Setting either *width* or *height* to *null* leaves this dimension untouched and results typically in distorted images. Examples:

```
{{ image | iresize(300, null) }}

```

resize only the width of the image. Likewise

```
{{ image | ifilter(null, 200) }}

```

resize only the height of the image

You can apply [Intervention](https://image.intervention.io/v2) *filters* to the image. See the Intervention [website](https://image.intervention.io/v2) for information about the available filters.

You can specify the filters as a Twig array:

```
{{ image | iresize(150, 100, [["blur", 1],["colorize", -100, 0, 0], ["flip"]])

```

Alternatively (but that this approach will be deprecated in the future) filters can be specified as a string, such as

```
{{ image | iresize(150, 100, "blur(1)->colorize(-100, 0, 0)->flip('v')" }}

```

Both examples would first resize the image to 150x100px, add a 1% blur filter, remove all red from the image and finally flip the image vertically.

By default, the plugin will serve an optimal image format depending on the rendering capabilities of the browser. If the optional parameter *extension* is specified, the plugin will convert the image to the image format corresponding to the extension. Valid extensions are *jpg, gif, tiff* and *webp*. If the respective image format supports compression, the *quality* can be explicitly set.

Consequence: If you specify an explicit *exentsion*, the browser might not be able to display it due to lack of functionality (e.g. *webp* images on certain Safari versions).

Twig Functions
--------------

[](#twig-functions)

### exif(\[key\])

[](#exifkey)

Returns an array (key/value) of all EXIF meta data from image. Alternatively, if a *key* is set, it returns a string with the value for that EXIF key. If no data is found, null is returned.

Example

```
exif("Model")

```

returns the camera's model name if set.

### iptc(\[key\])

[](#iptckey)

Returns an array (key/value) of all IPTC meta data from image. Alternatively, if a *key* is set, it returns a string with the value for that IPTC key. If no data is found, null is returned.

A word of caution
-----------------

[](#a-word-of-caution)

[Intervention](http://image.intervention.io) is rather resource-intensive. As a consequence:

- Apply [Intervention](http://image.intervention.io) filters carefully.
- For large files (at the moment, 8 megapixels), the initial resize of an image is handled by Winter's internal resizer. At the moment, this results in the original image being opened, resized, compressed, stored and then re-opened to apply any filers of the [Intervention](http://image.intervention.io) library before the final result is again compressed and saved to disk. This approach results generally in faster processing but re-compresses images twice, which implies a (slight) loss of quality.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance44

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2d4325040b5bcb235cf0f7555ec5b28498935f54c74bb90c3b2828461598500d?d=identicon)[mercator](/maintainers/mercator)

### Embed Badge

![Health badge](/badges/mercator-wn-media-plugin/health.svg)

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

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[char0n/ffmpeg-php

PHP wrapper for FFmpeg application

495225.1k1](/packages/char0n-ffmpeg-php)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)

PHPackages © 2026

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