Manual:Hooks/FileTransformed
FileTransformed | |
---|---|
Available from version 1.20.0 When a file is transformed and moved into storage. | |
Define function: | public static function onFileTransformed( $file, $thumb, $tmpThumbPath, $thumbPath ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"FileTransformed": "MediaWiki\\Extension\\MyExtension\\Hooks::onFileTransformed"
}
}
|
Called from: | File(s): File.php |
Interface: | FileTransformedHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:FileTransformed extensions.
Details
edit- $file: reference to the File object
- $thumb: the MediaTransformOutput object
- $tmpThumbPath: The temporary file system path of the transformed file
- $thumbPath: The permanent storage path of the transformed file