[eluser]Evil Wizard[/eluser]
The version of the upload class I have checks that the uploaded file is an image by comparing the file extension to an array of image mime types. The array in the code seems to be hard coded and ignores the mimes.php file
Code:
function is_image()
{
// IE will sometimes return odd mime-types during upload, so here we just standardize all
// jpegs or pngs to the same file type.
$png_mimes = array('image/x-png');
$jpeg_mimes = array('image/jpg', 'image/jpe', 'image/jpeg', 'image/pjpeg');
if (in_array($this->file_type, $png_mimes))
{
$this->file_type = 'image/png';
}
if (in_array($this->file_type, $jpeg_mimes))
{
$this->file_type = 'image/jpeg';
}
$img_mimes = array(
'image/gif',
'image/jpeg',
'image/png',
);
return (in_array($this->file_type, $img_mimes, TRUE)) ? TRUE : FALSE;
}
The set_image_properties() method checks the is_image() method to determine if the image properties need to be set, and uses getimagesize() to assign the values.
You need to change the last part of the function to include your bmp mime type as a valid image mime.
Code:
$img_mimes = array(
'image/gif',
'image/jpeg',
'image/png',
'image/x-ms-bmp'
);