Page 2 of 2

Posted: Wed Jul 19, 2006 5:29 pm
by bokehman
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.

Posted: Wed Jul 19, 2006 5:38 pm
by Luke
oh ok... I understand that.

Posted: Mon Jul 24, 2006 10:44 pm
by Trenchant
bokehman wrote:
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.
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.

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.
If you had an example of storing images in a session that would be great. I've never seen an example on it before.

Posted: Tue Jul 25, 2006 4:15 am
by bokehman
Write the image to the session:

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();
Read the image from the session to the browser:

Code: Select all

session_start();
header('Content-Type: image/jpeg');
echo $_SESSION['composite_image'];