tr5
asked on
How to convert gif to jpg
Hi
I upload gifs which I want to convert and save as jpgs. I do this:
...
$image = @imagecreatefromgif($filen ame);
if($image)
{
$image_p = imagecreatetruecolor($new_ width, $new_height);
imagecopyresampled($image_ p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagejpeg($image_p, $filename_tn, 100); // 100% quality
}
Will that do the job, or is something else needed?
Thanks
tr5
I upload gifs which I want to convert and save as jpgs. I do this:
...
$image = @imagecreatefromgif($filen
if($image)
{
$image_p = imagecreatetruecolor($new_
imagecopyresampled($image_
imagejpeg($image_p, $filename_tn, 100); // 100% quality
}
Will that do the job, or is something else needed?
Thanks
tr5
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
well - you have $image
= imagecreatefromgif($filena me)
you should just be able to point it to the uploaded file
= imagecreatefromgif($_FILE[ 'uploadedF ileName']) ;
and the rest of the script would remain the same
= imagecreatefromgif($filena
you should just be able to point it to the uploaded file
= imagecreatefromgif($_FILE[
and the rest of the script would remain the same
ASKER
ok. Thanks.
ASKER