Re: resize image not work in Firefox

Re: resize image not work in Firefox

am 30.03.2008 13:01:04 von Clint Dobbs

On Mar 22, 1:17 am, pt36 wrote:
> Hi
> I have this script for resize many differents images on a php page
>
> in the page miniature.php:
> > $maxx = "75";
> $maxy = "75";
> $source_image_URL = $_GET["src"];
> $source_image = imagecreatefromjpeg($source_image_URL);
> list($width, $height) = getimagesize($source_image_URL);
> $percent1 = $width / $maxx;
> $percent2 = $height / $maxy;
> $percent = max($percent1,$percent2);
> $new_eight = round($height /$percent);
> $new_width = round($width /$percent);
> $dest_image = imagecreatetruecolor($new_width, $new_eight);
> imagecopyresampled ($dest_image, $source_image, 0, 0, 0, 0,$new_width,
> $new_eight, $width, $height);
> header("Content-type: image/jpeg");
> imagejpeg($dest_image);
> imagedestroy($dest_image);
> imagedestroy($source_image);
> ?>
>
> this page was called from another pages detail.php
> in this page I have a table with 4 images and each image call the
> script
>
>
> In Explorer the script work well, also in Opera.
> In Firefox not work well and the first image on the table not appear
>
> Any suggestion please ?
>
> Thanks

The only thing I could think just by looking at it really quick is
that it might either be a header issue or a caching issue...the rest
is server side. Also, have you ever considered ImageMagick? It is
great software as well. Also, I personally do not like to create
images on the fly because if you have alot of images, page load can
take longer although it is great for conserving space. I do a
file_exists() and if its not found then build the file and copy it
where i want it to be referenced. That way, the next time the page is
called a new image will not have to be created. But that's just me.