Forums

PHP

This topic is locked

Image load time

Posted 25 May 2004 11:24:55
1
has voted
25 May 2004 11:24:55 Dave Desormeaux posted:
How can I improve load time of images on my photo album site?

I have pages with thumbnails of images; when the user mouses over the thumb, I've used the swap image behaviour to display a larger size image on the same page. Unfortunately it takes too long (for my taste) for the larger image to appear.

I am pulling everything from a mySQL DB, using PHP. Here is the code for that behaviour:

<a href="photodetail.php?photo_id=<?php echo $row_rsPlaces['photo_id']; ?>&country_id=<?php echo $row_rsPlaces['country_id']; ?>"><img src="thumbs/<?php echo $row_rsPlaces['thumb_file']; ?>" width="50" border="1" onmouseover="MM_setTextOfLayer('LayerDexcript','','<?php echo $row_rsPlaces['description']; ?>');MM_swapImage('main','','photos/<?php echo $row_rsPlaces['photo_file']; ?>',1)" onMouseOut="MM_swapImgRestore()" /></a>

There are too photo images to preload, so apart from reducing the quality of the jpeg (which is already at 6 in Photoshop) or reducing the size of the image, is there anything I can do?

This may be just an HTML question, but I'm hoping there is a way of calling the files from the DB that might improve things.

Here is the page in question:

d-squared.com/adventures/places_pics.php?country_id=3

Thanks!





Replies

Replied 25 May 2004 12:44:49
25 May 2004 12:44:49 Matt Machell replied:
Try preloading the images with Javascript. This might require some handcoding to work with your database grabbed images, but should mean the images start loading before the user starts mouseovers.

-Matt

DMX Zone Premium Content Author
Replied 25 May 2004 16:47:39
25 May 2004 16:47:39 Dale Stevenson replied:
You could always make a very low quality image of the same dimesions, and use this as the lowsrc attribute, this will allow slower connections to view the low image until the large (high quality) image has loaded

Reply to this topic