2007-04-22 17:34:09 +00:00
|
|
|
<?php
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
/**
|
|
|
|
|
* @file
|
|
|
|
|
* @ingroup Media
|
|
|
|
|
*/
|
2007-07-29 18:48:20 +00:00
|
|
|
|
2007-04-22 17:34:09 +00:00
|
|
|
/**
|
2007-07-29 18:48:20 +00:00
|
|
|
* Handler for Microsoft's bitmap format; getimagesize() doesn't
|
|
|
|
|
* support these files
|
2007-04-24 06:53:31 +00:00
|
|
|
*
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup Media
|
2007-04-22 17:34:09 +00:00
|
|
|
*/
|
|
|
|
|
class BmpHandler extends BitmapHandler {
|
2008-08-27 18:25:24 +00:00
|
|
|
// We never want to use .bmp in an <img/> tag
|
|
|
|
|
function mustRender( $file ) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Render files as PNG
|
|
|
|
|
function getThumbType( $text, $mime ) {
|
|
|
|
|
return array( 'png', 'image/png' );
|
|
|
|
|
}
|
2007-04-22 17:34:09 +00:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Get width and height from the bmp header.
|
|
|
|
|
*/
|
|
|
|
|
function getImageSize( $image, $filename ) {
|
|
|
|
|
$f = fopen( $filename, 'r' );
|
|
|
|
|
if(!$f) return false;
|
|
|
|
|
$header = fread( $f, 54 );
|
|
|
|
|
fclose($f);
|
|
|
|
|
|
|
|
|
|
// Extract binary form of width and height from the header
|
|
|
|
|
$w = substr( $header, 18, 4);
|
|
|
|
|
$h = substr( $header, 22, 4);
|
|
|
|
|
|
|
|
|
|
// Convert the unsigned long 32 bits (little endian):
|
|
|
|
|
$w = unpack( 'V' , $w );
|
|
|
|
|
$h = unpack( 'V' , $h );
|
|
|
|
|
return array( $w[1], $h[1] );
|
|
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
}
|