|
Posted by Alexander Fischer on 10/07/06 09:34
Hi,
Jerry Stuckle wrote:
> Displaying the 800x600 can be slow - even on a broadband connection.
ok. Then I can live with that.
> How large is the file?
Some 100 kb, on average...
> And I doubt PHP itself it the problem - unless you're doing something
> really strange.
Well, the only thing that really annoys me is the behavior of the page
in which I display some 30 thumbnails, which I create with this code:
if($showasthumb){
// Content type
header('Content-type: image/jpeg');
// Get new dimensions
list($width, $height) = getimagesize($imgname);
if($width>=$height){$new_width = $mwthumbs_width;$new_height =
$height * $new_width / $width;}else{$new_height =
$mwthumbs_height;$new_width = $width * $new_height / $height;}
// Resample
$image_p = imagecreatetruecolor($new_width, $new_height);
imagecopyresampled($image_p, $im, 0, 0, 0, 0, $new_width,
$new_height, $width, $height);
// Output
imagejpeg($image_p, null, 100);
exit();
When the thumbs page is loaded for the first time, it takes a few
moments to load, ok. Then I view an individual image. Then I click back
in the browser. And now: I instantly get to see the whole page with all
the images on it - probably from the cache. And then the browser starts
to reload image after image, rebuilding them line by line, and this
causes a flickering across the screen which takes around 2-3 seconds.
Would there be a way - e.g., a header information - to tell the browser
that these images do not need to be reloaded every single time?
Thanks,
Alex
[Back to original message]
|