Deseja renderizar uma imagem sem salvá-la em disco usando bibliotecas PHP GD
Oi tenho a seguinte função
function renderBusinessCard($details){
//Getting the template for the business card
$filename = Templates::model()->getTemplateFileName($details['BusinessCards']['dp_id']);
header("Content-type: image/jpeg");
$image = $_SERVER['DOCUMENT_ROOT'].'resources/templates/'.$filename;
// header("Content-Type: image/jpeg");
//Getting the width and height of the image
list($width,$height) = getimagesize($image);
//echo $width;die;
//Creating a copy of a loaded image
$create = imagecreatefromjpeg($image);
//Creating a blank template to work from
$template = imagecreatetruecolor($width,$height);
imagecopyresized($template, $create, 0, 0, 0, 0, $width, $height, $width, $height);
imagejpeg($template, null, 100);
}
O que eu quero alcançar é exibir a imagem em uma tag de imagem como a seguinte
<img src="<?php renderBusinessCard($details); ?>"
mas, de alguma forma, está sempre processando código ilegível na tela e não o resultado que desejo. Tudo isso é possível? E como, sem usar um arquivo separado, eu quero que isso permaneça dentro de uma função ou método.