php: recreate and display an image from binary data
Is it possible to recreate images from binary data (process them if needed) and display them, all in the same script? Something like
// get and display image 1:
$imagedata1 = file_get_contents('assets/test.png');
$imagedata1 = process_using_gd_or_something($imagedata1);
echo "<img src={$imagedata1} >"; // <-- IS THIS (OR EQUIVALENT) POSSIBLE?
// get and display image 2:
//etc...
I want to avoid storing the images to to disk after processing and getting them from there, or using an external script...