Re: Convert from jpg to gif ... change dpi...

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

 



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


[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