MediaWiki  1.23.15
BMP.php
Go to the documentation of this file.
1 <?php
30 class BmpHandler extends BitmapHandler {
35  function mustRender( $file ) {
36  return true;
37  }
38 
47  function getThumbType( $text, $mime, $params = null ) {
48  return array( 'png', 'image/png' );
49  }
50 
58  function getImageSize( $image, $filename ) {
59  $f = fopen( $filename, 'rb' );
60  if ( !$f ) {
61  return false;
62  }
63  $header = fread( $f, 54 );
64  fclose( $f );
65 
66  // Extract binary form of width and height from the header
67  $w = substr( $header, 18, 4 );
68  $h = substr( $header, 22, 4 );
69 
70  // Convert the unsigned long 32 bits (little endian):
71  try {
72  $w = wfUnpack( 'V', $w, 4 );
73  $h = wfUnpack( 'V', $h, 4 );
74  } catch ( MWException $e ) {
75  return false;
76  }
77 
78  return array( $w[1], $h[1] );
79  }
80 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
$mime
usually copyright or history_copyright This message must be in HTML not wikitext $subpages will be ignored and the rest of subPageSubtitle() will run. 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink' whether MediaWiki currently thinks this is a CSS JS page Hooks may change this value to override the return value of Title::isCssOrJsPage(). 'TitleIsAlwaysKnown' whether MediaWiki currently thinks this page is known isMovable() always returns false. $title whether MediaWiki currently thinks this page is movable Hooks may change this value to override the return value of Title::isMovable(). 'TitleIsWikitextPage' whether MediaWiki currently thinks this is a wikitext page Hooks may change this value to override the return value of Title::isWikitextPage() 'TitleMove' use UploadVerification and UploadVerifyFile instead where the first element is the message key and the remaining elements are used as parameters to the message based on mime etc Preferred in most cases over UploadVerification object with all info about the upload string $mime
Definition: hooks.txt:2584
$f
$f
Definition: UtfNormalTest2.php:38
wfUnpack
wfUnpack( $format, $data, $length=false)
Wrapper around php's unpack.
Definition: GlobalFunctions.php:4084
$params
$params
Definition: styleTest.css.php:40
BmpHandler\getImageSize
getImageSize( $image, $filename)
Get width and height from the bmp header.
Definition: BMP.php:58
MWException
MediaWiki exception.
Definition: MWException.php:26
BitmapHandler
Generic handler for bitmap images.
Definition: Bitmap.php:29
BmpHandler\mustRender
mustRender( $file)
Definition: BMP.php:35
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
BmpHandler\getThumbType
getThumbType( $text, $mime, $params=null)
Render files as PNG.
Definition: BMP.php:47
$file
if(PHP_SAPI !='cli') $file
Definition: UtfNormalTest2.php:30
BmpHandler
Handler for Microsoft's bitmap format; getimagesize() doesn't support these files.
Definition: BMP.php:30
$e
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging $e
Definition: hooks.txt:1632