PHPackages                             nelson/resizer - 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. nelson/resizer

ActiveLibrary[Image &amp; Media](/categories/media)

nelson/resizer
==============

Resizer Extension for Nette Framework &amp; Latte

8.2.0(2y ago)11.9kPHPPHP ^8.1

Since Jan 8Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Gappa/Resizer)[ Packagist](https://packagist.org/packages/nelson/resizer)[ RSS](/packages/nelson-resizer/feed)WikiDiscussions 8.x Synced 1mo ago

READMEChangelog (10)Dependencies (13)Versions (45)Used By (0)

Installation
============

[](#installation)

1. Composer: `composer require nelson/resizer`
2. Register:

    ```
    extensions:
    	resizer: Nelson\Resizer\DI\ResizerExtension
    ```
3. Config:

    This is the bare minimum required:

    ```
    resizer:
    	library: 'Imagick' # Imagick|Gmagick|Gd
    	wwwDir: %wwwDir%
    	tempDir: %tempDir%
    ```

    Other options with their defaults:

    ```
    resizer:
    	interlace: true # for progressive JPEGs
    	strip: true # removes image metadata, color profiles etc.
    	cache: '/resizer/'
    	qualityAvif: 70 # 0 - 100
    	qualityWebp: 70 # 0 - 100
    	qualityJpeg: 70 # 0 - 100
    	compressionPng: 9 # 0 - 9
    	upgradeJpg2Webp: true # automatically convert JPEGs to WEBP when the format is supported by the browser & server
    	upgradeJpg2Avif: true # automatically convert JPEGs to AVIF when the format is supported by the browser & server
    	upgradePng2Webp: true # automatically convert PNGs to WEBP when the format is supported by the browser & server
    	upgradePng2Avif: true # automatically convert PNGs to AVIF when the format is supported by the browser & server
    ```

There is also an upgrade/downgrade logic for AVIF &amp; WEBP. Most preferred is the original AVIF/WEBP, then each other, finally JPEG.

AVIF is preferred over WEBP in case both upgrades are enabled.

Usage
=====

[](#usage)

Order of parameters is dependant on the router, the default is:

1. Dimensions &amp; modifiers. `string`
2. Image file. `string`
3. Format. `string`

Dimensions &amp; modifiers
--------------------------

[](#dimensions--modifiers)

Syntax: - `[ifresize-][[cropX]width]x[[cropY]height][forceDimensions][-quality]`

### Dimensions:

[](#dimensions)

- `100x100` - width and height must be equal or less, resized according to AR.
- `x100` - height must be equal or less.
- `100x` - width must be equal or less.
- `100x50!` - dimensions are forced without respecting ifresize and AR.
- Cropping:
    - width: `l` - left, `c` - center, `r` - right.
    - height: `t` - top, `c` - center, `b` - bottom.
    - Example: `c100xc100`

### Modifiers:

[](#modifiers)

- `ifresize`
    - Example: `ifresize-100x200`
    - If the image is smaller than the desired width and/or height, image will not be enlarged.
- Quality
    - Example: `x-q50` - sets just the quality without any resize.
    - For WEBP/AVIF quality set to `100` means lossless compression.

Format:
-------

[](#format)

- The format parameter can be used to switch between image file formats, e.g. `` in `` tag for converting jpegs to WEBP/AVIF.

Relative and absolute URLs
==========================

[](#relative-and-absolute-urls)

Relative:

- ``

Absolute, uses diffent tag:

- ``
- `Link to image`

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity84

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

Total

44

Last Release

992d ago

Major Versions

3.x-dev → 4.3.02020-02-11

4.x-dev → 5.0.02020-06-25

5.x-dev → 6.0.02021-03-25

6.2.0 → 7.0.02022-10-26

7.x-dev → 8.0.02023-01-23

PHP version history (6 changes)v1.0PHP ^5.6

v1.2PHP ^5.6 || ^7.0 || ^7.1

v3.0PHP &gt;= 7.1

6.0.0PHP &gt;= 7.4

6.x-devPHP ^8.0

8.1.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/b4e805c40ec66ed697671aed10e809e3eff9f0a04688fffd7a5698d722dcff6a?d=identicon)[Gappa](/maintainers/Gappa)

---

Top Contributors

[![Gappa](https://avatars.githubusercontent.com/u/749981?v=4)](https://github.com/Gappa "Gappa (105 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nelson-resizer/health.svg)

```
[![Health](https://phpackages.com/badges/nelson-resizer/health.svg)](https://phpackages.com/packages/nelson-resizer)
```

###  Alternatives

[brabijan/images

Image storage for Nette Framework

5617.7k](/packages/brabijan-images)[tomaj/nette-api

Nette api

36261.8k4](/packages/tomaj-nette-api)[pavlista/nette-palette

Palette support for Nette Framework and Latte template engine

1657.4k](/packages/pavlista-nette-palette)[dotblue/nette-webimages

On-the-fly generated web images for your Nette app

262.1k](/packages/dotblue-nette-webimages)[baraja-core/image-generator

Full automatic ImageGenerator for creating dynamic content by URL.

1355.1k1](/packages/baraja-core-image-generator)[kollarovic/thumbnail

Generating image thumbnails

1035.5k2](/packages/kollarovic-thumbnail)

PHPackages © 2026

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