With this code, I am trying to create an image of a signature from JSON and then display the image directly in the browser without saving it. The problem I have is I want to display this image within a HTML document so the header information has already been modified. Is there a way to display an image from it's raw image data within an HTML document? Or any other way around this issue?
$json = $ticket->sig; // get the json representing the signature
$img = sigJsonToImage($json); //get image resource from json
// HERE I WANT TO DISPLAY THE IMAGE BUT GET Cannot modify header information
header('Content-Type: image/png');
imagepng($img, null, 0, PNG_NO_FILTER);
imagedestroy($img);