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

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

mercator/wn-queuedresize-plugin
===============================

Queued image and PDF resizing plugin for Winter CMS, providing a drop-in replacement for the resize filter with background processing and modern formats.

010PHP

Since Dec 28Pushed 3mo agoCompare

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

READMEChangelog (1)DependenciesVersions (1)Used By (0)

Queued Resize Plugin for WinterCMS (Mercator.QueuedResize)
==========================================================

[](#queued-resize-plugin-for-wintercms-mercatorqueuedresize)

This plugin provides an asynchronous and memory-efficient solution for handling image resizing in WinterCMS. By offloading resource-intensive image processing to the Laravel Queue, it prevents synchronous page loads from becoming slow and avoids server exhaustion, making it ideal for large media libraries and high-traffic environments.

### Features

[](#features)

SummaryCategoryFeatureBenefit**Performance**Asynchronous ProcessingUser does not wait for image creation; page loads remain fast.Instant feedback on the frontend.**Optimization**Local Disk Path HandlingAvoids unnecessary memory consumption by reading file paths instead of entire file content into PHP.Lower RAM overhead per process.**Resilience**Memory-Efficient PDF HandlingOptimizes ImageMagick to process PDFs at low DPI and only the first page.Prevents memory leaks and crashes.**Control**CLI Tools (`warmup`, `clear`, `prune`)Provides complete cache and maintenance control via the command line.Automated maintenance workflows.**Stability**Concurrency ControlUses a semaphore lock to cap simultaneous resize jobs.Protects server CPU/RAM from overload.---

1. Installation and Configuration (`.env`)
------------------------------------------

[](#1-installation-and-configuration-env)

The plugin uses a dedicated configuration file (`config.php`) which pulls its values from your main `.env` file. You should place these variables in your environment file to easily manage your setup across different deployments (staging, production).

### `.env` Variables

[](#env-variables)

VariableDefault ValueDescriptionUsed In`IMAGE_RESIZE_QUEUE``imaging`The name of the queue the resize jobs will be dispatched to.`ProcessImageResize.php``IMAGE_RESIZE_DRIVER``gd`The Intervention Image driver to use: `gd` or `imagick`.`ImageResizer.php``IMAGE_RESIZE_DISK``local`The default storage disk for reading source files and writing cache files.`All components``IMAGE_RESIZE_QUALITY``80`The fallback JPEG/WebP output quality (0-100).`ImageResizer.php``IMAGE_RESIZE_CONCURRENCY``3`**(Critical)** The max simultaneous resize jobs that can run at once.`ProcessImageResize.php``IMAGE_RESIZE_BACKOFF``5`Seconds a job waits before re-release if the concurrency limit is reached.`ProcessImageResize.php`### Starting Queue Workers

[](#starting-queue-workers)

The plugin is useless without a running queue worker. You should use a process manager (like Supervisor) to ensure this command runs continuously:

```
# Start a worker process dedicated to the 'imaging' queue
php artisan queue:work --queue=imaging --tries=3 --timeout=3600
```

---

2. Twig Filter: `qresize` - Detailed Parameters
-----------------------------------------------

[](#2-twig-filter-qresize---detailed-parameters)

The `qresize` filter is the primary tool for using the plugin in your templates. It instantly returns a URL, deferring the actual work to the background.

### Twig Syntax

[](#twig-syntax)

```
{{ image.path | qresize(width, height, options) }}
```

### Parameters

[](#parameters)

ParameterTypeRequiredDescriptionExample**`src`**`string`YesThe source path to the original image file.`image.path`**`width`**`int/null`NoDesired output width. Required if `height` is null.`400`**`height`**`int/null`NoDesired output height. Required if `width` is null.`300`**`options`**`array`NoKey/value pairs to control the resizing process.`{'mode': 'crop', 'quality': 90}`### Options Array Keys (`opts`)

[](#options-array-keys-opts)

KeyTypeDescriptionDefault**`mode`**`string`Resizing mode: `auto`, `crop`, or `fit`.`'auto'`**`quality`**`int`Output quality for JPEG/WebP (0-100).`80`**`format`**`string``jpg`, `webp`, `png`, `gif`, or `best` (client-aware WebP).`'best'`**`disk`**`string`**Overrides** the default disk for this specific request.`'local'`---

3. PHP Block Functionality: `queuedresize_path()`
-------------------------------------------------

[](#3-php-block-functionality-queuedresize_path)

This function is registered to allow developers to trigger asynchronous directory-based resizing directly from custom PHP code (e.g., in a component's `onStart()` method or a CMS page's `code` block).

### Function Call Syntax

[](#function-call-syntax)

```
queuedresize_path($path, $w, $h, $opts = [], $recursive = false, $disk = null);
```

### Function Parameters

[](#function-parameters)

ParameterTypeRequiredDescription**`$path`**`string`YesPath to a **directory** or **file**. Resolves to parent folder if a file.**`$w`**`int/null`NoThe desired output width in pixels.**`$h`**`int/null`NoThe desired output height in pixels.**`$opts`**`array`NoArray of options (`mode`, `quality`, etc.) passed to the job.**`$recursive`**`bool`NoSet to `true` to scan subdirectories within the resolved path.**`$disk`**`string/null`No**Overrides** the default disk to use for this batch job.**Example Usage in a Component:**

```
function onStart()
{
    // When the component initializes, it queues all images in 'media/user-uploads'
    // to be resized to 1024px wide.
    $jobsQueued = queuedresize_path(
        'user-uploads/latest-image.jpg', // Path resolves to the 'user-uploads' directory
        1024,
        null,
        ['quality' => 85, 'format' => 'webp'],
        true, // Recursive
        'media' // Uses the 'media' disk
    );
}
```

---

4. Command Line Interface (CLI) - All Parameters
------------------------------------------------

[](#4-command-line-interface-cli---all-parameters)

### A. `queuedresize:warmup` (Batch Processing)

[](#a-queuedresizewarmup-batch-processing)

Recursively generates resized images for a directory.

ParameterAliasRequiredDescriptionExample Value**`path`**(arg)YesRelative folder path to scan (inside `storage/app/media`).`"media/gallery"`**`--width`**NoTarget width(s) (comma-separated).`400,800`**`--height`**NoTarget height(s) (comma-separated).`200`**`--format`**NoOutput formats (comma-separated).`jpg,webp`**`--recursive`**`-r`NoScans subdirectories within the specified `path`.`(flag only)`**`--force`**`-f`No**Forces** regeneration even if cache is valid.`(flag only)`**`--disk`**NoThe specific storage disk to operate on.`uploads`**`--mode`**NoResize mode (auto, crop, fit).`crop`**`--quality`**NoOutput quality (0-100).`90`**Example Usage:**

```
php -d memory_limit=1024M artisan queuedresize:warmup "media/gallery" --width=400,800 --format=jpg,webp --recursive --force
```

### B. `queuedresize:clear` (Cache Cleanup)

[](#b-queuedresizeclear-cache-cleanup)

Removes resized images based on filter criteria.

ParameterRequiredDescriptionExample Value**`--disk`**NoThe storage disk to clear the cache from.`local`**`--width`**NoClear only images matching this target width.`400`**`--height`**NoClear only images matching this target height.`300`**`--path`**NoFilter by segment of the original source file path.`products/banners`**`--dry-run`**NoDisplays matching files without deleting them.`(flag only)`---

### C. `queuedresize:prune` (Orphan Removal)

[](#c-queuedresizeprune-orphan-removal)

Removes cached resized images where the original source file no longer exists.

ParameterRequiredDescriptionExample Value**`--disk`**NoThe storage disk to prune the cache on.`media`**`--dry-run`**NoDisplays which orphans would be deleted.`(flag only)`**Example Usage:**

```
# Delete all orphan files on the default disk
php artisan queuedresize:prune
```

Would you like me to help you set up a **Supervisor configuration file** to manage your queue workers?

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance56

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity12

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-queuedresize-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/mercator-wn-queuedresize-plugin/health.svg)](https://phpackages.com/packages/mercator-wn-queuedresize-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.0k22](/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)
