Extract EXIF data from an image blob (binary string) in PHP

Adding @rymo’s comment on @MarcB’s answer as a separate answer:

This works:

$exif = exif_read_data("data://image/jpeg;base64," . base64_encode($image));
echo $exif['Orientation'];

A stream wrapper can turn your string/image into something useable as a filehandle, as shown here. However, I can't see any way of turning that filehandle into something that can masquerade as the filename that exif_read_data expects.

You might try passing the data:// pseudo-url listed on that page and see if the exif function will accept it.