Re: Convert gif to jpg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This should work for you:

$image_dimensions = @getimagesize($uploadedfilename);
$src_image = @imagecreatefromgif($uploadedfilename);
$resized_image = @imagecreatetruecolor($width,$height); // can be resized, 
or else set these vars to the same as the original
if (($src_image)  && ($resized_image)) {
    if( 
imagecopyresampled($resized_image,$src_image,0,0,0,0,$iw,$ih,$image_dimensions[0],$image_dimensions[1]) 
 ){
        $filepath = "/path/to/new/image/newimagename.jpg";
        $jpg_quality = 80;
        imagejpeg($resized_image, $filepath, $jpg_quality);
    }
}





"Roman Duriancik" <rduriancik@xxxxxxxxxxxxxx> wrote in message 
news:4264EE4B.8070207@xxxxxxxxxxxxxxxxx
> Hello,
> Is it possible to convert pictures in gif format to jpg format in php 
> script ?
> Thank you for yours responses.
> Roman 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux