Re: Shrinking gifs.. .

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

 



nikos wrote:
Thank you Martin
I install new gd, reconfigure php and now is running OK.

But, it was a mass to realize that shortening gifs results to loss
transparency(!).
[snip]

imagecolortransparent()

That function will set the transparent color in an image (only one per image). If you read the description carefully it says that it will return the existing one if you don't specify a new color...

so:
$transparent_color = imagecolortransparent($uploaded_img);
imagecolortransparent($thumbnail, $transparent_color);

That should get you and Nadim what you're looking for, assuming things work as promised (I've never used it myself).

If you need to work with pngs and the likes, imagecolorexactalpha / imagecolorclosestalpha - requires GD 2.01 and PHP 4.0.6 (imagecolorallocatealpha requires PHP 4.3.2 though, oddly enough)

cheers,
--
- Martin Norland, Sys Admin / Database / Web Developer, International Outreach x3257 The opinion(s) contained within this email do not necessarily represent those of St. Jude Children's Research Hospital.

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux