You are here: Re: Convert gif to jpg « PHP « IT news, forums, messages
Re: Convert gif to jpg

Posted by scottkovach on 04/20/05 00:32

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@indprop.gov.sk> wrote in message
news:4264EE4B.8070207@indprop.gov.sk...
> Hello,
> Is it possible to convert pictures in gif format to jpg format in php
> script ?
> Thank you for yours responses.
> Roman

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация