After these lines:
...
$config['allowed_types'] = 'gif|jpg|png|bmp|jpeg';
...
$this->load->library('upload', $config);
$this->upload->do_upload();
The .bmp file was successfully uploaded to the host. However, getting the uploaded data's width and height returns and empty value:
$imgdata = $this->upload->data();
print_r($imgdata);
That is, $imgdata['image_width']
and $imgdata['image_height']
do not have any value at all.
I've tried uploading other image file types, other than bmp. Its height and width are valid numbers.
Why does this happen to only .bmp image? And how do I fix this?
EDIT:
Here are the contents of $imgdata
upon print_r()
;
[file_name] => 58ea3c1f14b45d7c1c2c0e0c1920af772b9ebf09.bmp
[file_type] => image/bmp
[file_path] => path/
[full_path] => path/58ea3c1f14b45d7c1c2c0e0c1920af772b9ebf09.bmp
[raw_name] => 58ea3c1f14b45d7c1c2c0e0c1920af772b9ebf09
[orig_name] => 58ea3c1f14b45d7c1c2c0e0c1920af772b9ebf09.bmp
[client_name] => samplebmp.bmp
[file_ext] => .bmp
[file_size] => 2484.45
[is_image] =>
[image_width] =>
[image_height] =>
[image_type] =>
[image_size_str] =>
Why does the image file not recognized as image?