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;




use Event;

Event::listen('system.resizer.processResize', function () {
    // Your event listener code goes here...


Class or file Line
System\Classes\ImageResizer 297
Copyright © 2024 Winter CMS