So after searching through multiple documentation sources I'm still no closer to figuring out how to extract the Mime type from a data URI that has already been processed and stored in a DB.
That is a quick snap shot of the exact data I have to work with. I just want a dynamic way to always get the "image/png" part which may change with each image in the DB.
I'm using PHP.
Not an elegant solution, but you could do:
// assume you've set $image_uri to be the URI from the database $image_parts = explode(";", $image_uri); // split on the ; after the mime type $mime_type = substr($image_parts, 5); // get the information after the data: text
It could be done with regular expressions, but I'm not good enough at them to come up with it.