lemmin Posted December 8, 2008 Share Posted December 8, 2008 I am creating an image using the GD libraries and I want to display it without saving the actual file on the server. Noramally I would just use an image header on the page to do this, but I need information that I am accumulating while creating the image. If I made a separate file to create the image and then link to it, I wouldn't be able to get that information. Also, image resources can't be serialized or saved in a session variable. Any ideas? Thanks. Link to comment https://forums.phpfreaks.com/topic/136100-solved-displaying-an-image-without-saving-it-on-the-server/ Share on other sites More sharing options...
rhodesa Posted December 8, 2008 Share Posted December 8, 2008 can you gather the data you need to make the image, save it to the session, then link to a file that uses that session info to make/display the image? Link to comment https://forums.phpfreaks.com/topic/136100-solved-displaying-an-image-without-saving-it-on-the-server/#findComment-709672 Share on other sites More sharing options...
lemmin Posted December 8, 2008 Author Share Posted December 8, 2008 I can't do that because the information is collected per pixel as I create the image. Thanks for the idea, though. Link to comment https://forums.phpfreaks.com/topic/136100-solved-displaying-an-image-without-saving-it-on-the-server/#findComment-709697 Share on other sites More sharing options...
rhodesa Posted December 8, 2008 Share Posted December 8, 2008 depending on how big the image is, you can store the image into a session variable: session_start(); ob_start(); imagepng($im); imagedestroy($im); $_SESSION['image'] = ob_get_clean(); Link to comment https://forums.phpfreaks.com/topic/136100-solved-displaying-an-image-without-saving-it-on-the-server/#findComment-709698 Share on other sites More sharing options...
lemmin Posted December 8, 2008 Author Share Posted December 8, 2008 It works! Thank you! Link to comment https://forums.phpfreaks.com/topic/136100-solved-displaying-an-image-without-saving-it-on-the-server/#findComment-709753 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.