35 return ( $file->getWidth() && $file->getHeight() );
39 return [
'img_width' =>
'width' ];
43 if (
in_array( $name, [
'width',
'height' ] ) ) {
56 $width =
$params[
'physicalWidth'];
63 # Removed for ProofreadPage
64 # $width = intval( $width );
71 return [
'width' => $m[1] ];
78 return [
'width' =>
$params[
'width'] ];
87 $mimeType =
$image->getMimeType();
110 # Height & width were both set
111 if (
$params[
'width'] * $srcHeight >
$params[
'height'] * $srcWidth ) {
112 # Height is the relative smaller dimension, so scale width accordingly
116 # Very small image, so we need to rely on client side scaling :(
122 # Height was crap, unset it so that it will be calculated later
128 # Passed all validations, so set the physicalWidth
132 # Because thumbs are only referred to by width, the height always needs
133 # to be scaled by the width to keep the thumbnail sizes consistent,
134 # even if it was set inside the if block above
138 # Set the height if it was not validated in the if block higher up
144 $params[
'physicalHeight'], $srcWidth, $srcHeight, $mimeType )
163 $width =
intval( $width );
165 # Sanity check $width
167 wfDebug( __METHOD__ .
": Invalid destination width: $width\n" );
171 if ( $srcWidth <= 0 ) {
172 wfDebug( __METHOD__ .
": Invalid source width: $srcWidth\n" );
178 if ( $height == 0 ) {
179 # Force height to be at least 1 pixel
231 $widthheight =
wfMessage(
'widthheight' )
232 ->numParams( $file->getWidth(), $file->getHeight() )->escaped();
234 return "$widthheight ($nbytes)";
243 $pages = $file->pageCount();
245 if ( $pages ===
false || $pages <= 1 ) {
246 $msg =
wfMessage(
'file-info-size' )->numParams( $file->getWidth(),
247 $file->getHeight() )->params( $size,
248 '<span class="mime-type">' . $file->getMimeType() .
'</span>' )->parse();
250 $msg =
wfMessage(
'file-info-size-pages' )->numParams( $file->getWidth(),
251 $file->getHeight() )->params( $size,
252 '<span class="mime-type">' . $file->getMimeType() .
'</span>' )->numParams( $pages )->parse();
263 $pages = $file->pageCount();
266 ->numParams( $file->getWidth(), $file->getHeight(), $pages )->text();
269 ->numParams( $file->getWidth(), $file->getHeight() )->text();
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfAppendQuery( $url, $query)
Append a query string to an existing URL, which may or may not already have query string parameters a...
static scaleHeight( $srcWidth, $srcHeight, $dstWidth)
Calculate the height of a thumbnail using the source and destination width.
Media handler abstract base class for images.
getImageSize( $image, $path)
Get an image size array like that returned by getimagesize(), or false if it can't be determined.
sanitizeParamsForBucketing( $params)
Returns a normalised params array for which parameters have been cleaned up for bucketing purposes.
getImageArea( $image)
Function that returns the number of pixels to be thumbnailed.
validateThumbParams(&$width, &$height, $srcWidth, $srcHeight, $mimeType)
Validate thumbnail parameters and fill in the correct height.
getParamMap()
Get an associative array mapping magic word IDs to parameter names.
normaliseParams( $image, &$params)
parseParamString( $str)
Parse a param string made with makeParamString back into an array.
makeParamString( $params)
Merge a parameter array into a string appropriate for inclusion in filenames.
validateParam( $name, $value)
Validate a thumbnail parameter at parse time.
getScriptedTransform( $image, $script, $params)
getScriptParams( $params)
getDimensionsString( $file)
Media transform output for images.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable modifiable after all normalizations have been except for the $wgMaxImageArea check $image
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation use $formDescriptor instead default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<div ...>$1</div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services