Email subject in content language instead of sending user's UI language
[lhc/web/wiklou.git] / includes / media / BMP.php
1 <?php
2
3 /**
4 * Handler for Microsoft's bitmap format; getimagesize() doesn't
5 * support these files
6 *
7 * @addtogroup Media
8 */
9 class BmpHandler extends BitmapHandler {
10
11 /*
12 * Get width and height from the bmp header.
13 */
14 function getImageSize( $image, $filename ) {
15 $f = fopen( $filename, 'r' );
16 if(!$f) return false;
17 $header = fread( $f, 54 );
18 fclose($f);
19
20 // Extract binary form of width and height from the header
21 $w = substr( $header, 18, 4);
22 $h = substr( $header, 22, 4);
23
24 // Convert the unsigned long 32 bits (little endian):
25 $w = unpack( 'V' , $w );
26 $h = unpack( 'V' , $h );
27 return array( $w[1], $h[1] );
28 }
29 }