I have an image from a blob database field.
is there any way to check the mime type of a field without saving?
getimagesize() and mime_content_type()
requires filename…
i want to do something like this:
<img \n" . 'src="data:image/gif;base64,' . $base64 .
'" alt="base64 img" width="80" height="15" />
When you insert file data into your database, you really should be saving the MIME type with it. Detection isn’t perfect, and is at least slower.
In any case:
From: Detecting image type from base64 string in PHP