Re: Convert from jpg to gif ... change dpi...
| From: | Richard Lynch | Date: | Mon, 08 May 2006 17:52:13 +0000 |
| Subject: | Re: Convert from jpg to gif ... change dpi... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-235737@lists.php.net to get a copy of this message | ||
On Sun, May 7, 2006 4:07 pm, Gustav Wiberg wrote:
> Is there any way of converting a jpg to gif and change dpi on the fly?
<?php
$source = "/full/path/to/image.jpg";
$image = imagecreatefromjpeg($image);
//optional step, to REALLY trim that sucker down:
//cut this step out if it looks really bad.
//this gives you more control of what you call "change the DPI"
//GIF is already going to chop it down to 256 colors.
imagetruecolortopalette($image, FALSE, 16);
header("Content-type: image/gif");
imagegif($image);
?>
--
Like Music?
http://l-i-e.com/artists.htm