Looking for a way to store temporary images
Moderator: General Moderators
Actually I think where the confusion is coming from is this: 10 options with 10 choices means 10 rows and 10 columns which on the surface does seem to be 100 but the 100 selectable objects is not what is of interest; the important thing is the number of possible outcomes and that certainly is 10 billion.
If you had an example of storing images in a session that would be great. I've never seen an example on it before.bokehman wrote:Lets say you had 10 features with 10 choices in each; that is 10^10 or put another way 10 billion combinations. Add a few more choices and possibilites and you are talking an infinite number of images. Caching is just going to fill your hard drive with images that will probably only ever be requested once.Web Dummy wrote:Would creating the image every time the user loads the page still be resourseful? There will be two views of a users car, the front and the side.
Storing the image in the session would work though and if you need code for this I'd be happy to help you out.
If though they already had downloaded the images of the parts to local in order to choose them my method above should work fine.
Write the image to the session:Read the image from the session to the browser:
Code: Select all
// create the image here with GD... if
// you don't know how I can help you
// Save it to the session array
session_start();
ob_start();
imagejpeg($resource);
$_SESSION['composite_image'] = ob_get_clean();Code: Select all
session_start();
header('Content-Type: image/jpeg');
echo $_SESSION['composite_image'];