3 * Handler for Microsoft's bitmap format
10 * Handler for Microsoft's bitmap format; getimagesize() doesn't
15 class BmpHandler
extends BitmapHandler
{
21 function mustRender( $file ) {
33 function getThumbType( $text, $mime, $params = null ) {
34 return array( 'png', 'image/png' );
38 * Get width and height from the bmp header.
44 function getImageSize( $image, $filename ) {
45 $f = fopen( $filename, 'r' );
49 $header = fread( $f, 54 );
52 // Extract binary form of width and height from the header
53 $w = substr( $header, 18, 4);
54 $h = substr( $header, 22, 4);
56 // Convert the unsigned long 32 bits (little endian):
57 $w = unpack( 'V' , $w );
58 $h = unpack( 'V' , $h );
59 return array( $w[1], $h[1] );