system.resizer.processCrop

Halting event that enables replacement of the cropping 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.processCrop', function ((\System\Classes\ImageResizer) $resizer, (string) $localTempPath) { // Get the resizing configuration $config = $resizer->getConfig();

 // Resize the image
 $resizedImageContents = My\Custom\Resizer::crop($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;

});

Usage

Triggers

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