Open main menu

Manual:Hooks/BitmapHandlerTransform

BitmapHandlerTransform
Available from version 1.18.0 (r84278)
Before a file is transformed, gives extension the possibility to transform it themselves.
Define function:
public static function onBitmapHandlerTransform( $handler, $image, &$scalerParams, &$mto ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"BitmapHandlerTransform": "MyExtensionHooks::onBitmapHandlerTransform"
	}
}

For MediaWiki ≤1.25:

$wgHooks['BitmapHandlerTransform'][] = 'MyExtensionHooks::onBitmapHandlerTransform';
Called from:File(s): media/TransformationalImageHandler.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:BitmapHandlerTransform extensions.

DetailsEdit

  • $handler: BitmapHandler
  • $image: File
  • &$scalerParams: Array with scaler parameters
  • &$mto: null, set to a MediaTransformOutput