I'm storing small images in database (MySQL, blob
), so when I retrieve any image it's in variable.
My plan is to display image with CSS as base64 encoded in background image: background: url(data:image/…
.
To perform that I need to detect MIME type of image which is in variable. There's exif_imagetype, but it works only with files.
Is there any way to detect MIME type of image which isn't stored as file, but in variable?