- handles media resizing or cropping
- use configured image manipulation engine (GD or IM) to resize or crop media as needed
This event can be used to alter the resizing or cropping process in lib/exe/fetch.php. It can be used to prevent the native resizing algorithm in whatever case is required, for example, if there is a need to use a specific algorithm not available in DokuWiki, or disable resizing for certain file extensions. This is processed before the MEDIA_SENDFILE but after FETCH_MEDIA_STATUS and offers a BEFORE and an AFTER processing.
The native resizing algorithm can be prevented by calling
$event->preventDefault() in the BEFORE process.
If manipulating the image, the processed image's URL should be set as $data['file'] in the AFTER process.
- $data['media'] – The id for the called file
- $data['file'] – The filename of the file about to be delivered, can be modified by your plugin
- $data['mime'] – The Mime-Type of the file, can be modified by your plugin
- $data['download'] – Whether the file is to be downloaded or displayed inline
- $data['cache'] – The wanted cache behavior (-1 = cache forever, 0 = never cache, >0 cache time in seconds), can be modified by your plugin
- $data['ext'] – Extension of the file
- $data['width'] – Images only: the wanted width as specified in the request
- $data['height'] – Images only: the wanted height as specified in the request
- $data['status'] – The current status code of the request
- $data['statusmessage'] – The status message corresponding to the status above