I have a resource object (image) that has been created from imagecreatetruecolor after lots of process.
$image = imagecreatetruecolor($dst_width, $dst_height);
Last step is adding iptc tags to the image.
For adding iptc tags php has native function which is called iptcembed
iptcembed ( string $iptcdata , string $jpeg_file_name [, int $spool ] );
Problem is : I'm storing image as resource object. But iptcembed needs image as file path string $jpeg_file_name.
For every image I should save image and load it from iptcembed for iptc tags.
This is big performance issue. Also dirty codes.
I suppose that php wrappers could be solution for this problem but I learned that they are not paths. They are only references. Following code did not worked for me.
$data = null;
ob_start();
imagejpeg($this->image['src_image'], null, $compression);
$data = ob_get_contents();
ob_end_clean();
$img = fopen("php://temp", 'wb+');
fwrite($img, $data);
fclose($img);
$content = iptcembed('', "php://temp");
Question is : Are there any trick that I can reach to this imagepath from memory / of better way to accomplish that?