Manual:Hooks/BitmapHandlerCheckImageArea

From MediaWiki.org
Jump to navigation Jump to search
BitmapHandlerCheckImageArea
Available from version 1.19.0
Called by BitmapHandler::normaliseParams(), after all normalizations have been performed, except for the $wgMaxImageArea check.
Define function:
public static function onBitmapHandlerCheckImageArea( $image, &$params, &$checkImageAreaHookResult ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"BitmapHandlerCheckImageArea": "MyExtensionHooks::onBitmapHandlerCheckImageArea"
	}
}

For MediaWiki ≤1.25:

$wgHooks['BitmapHandlerCheckImageArea'][] = 'MyExtensionHooks::onBitmapHandlerCheckImageArea';
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:BitmapHandlerCheckImageArea extensions.

Details[edit]

  • $image: File
  • &$params: Array of parameters
  • &$checkImageAreaHookResult: null, set to true or false to override the $wgMaxImageArea check result