system.resizer.processResize

Triggered in: System\Classes\ImageResizer.php

Halting event that enables replacement of the resizing process. There should only ever be one listener handling this event per project at most, as other listeners would be ignored.

Example usage:

Event::listen('system.resizer.processResize', function ((\System\Classes\ImageResizer) $resizer, (string) $localTempPath) {
     // Get the resizing configuration
     $config = $resizer->getConfig();

     // Resize the image
     $resizedImageContents = My\Custom\Resizer::resize($localTempPath, $config['width], $config['height'], $config['options']);

     // Place the resized image in the correct location for the resizer to finish processing it
     file_put_contents($localTempPath, $resizedImageContents);

     // Prevent any other resizing replacer logic from running
     return true;
});

Keep informed

Sign up to our newsletter to receive updates on Winter CMS releases, new features in the works, and much more.
We'll never spam or give this address away.

Latest blog post

The Winter CMS Web Installer is now available!

Published June 17, 2021
We are super excited to announce that our new Web-based Installer is finally available for download, to make it super easy to get your next Winter CMS project started!

View this post Read all posts

Latest Winter CMS release

v1.1.3

Released April 26, 2021
3 UX/UI Improvements, 19 API Changes, 23 Bug Fixes, 3 Security Improvements, 4 Translation Improvements, 1 Community Improvement, 2 Dependencies

View details View all releases