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. Quote 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? Quote 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. Quote 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(); Quote 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! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.