My application is having images sent to it from mobile devices with the content-type \"application/octet-stream\".
I need to process these images using the GD librar
you can use this function too. it not require any other dependency. and work perfectly for other types also.
function _getmime($file){ if($info = @getimagesize($file)) { return image_type_to_mime_type($info[2]); } else { return mime_content_type($file); } }