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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php