gif resize support? Anyone? Anyone?
Moderator: General Moderators
gif resize support? Anyone? Anyone?
First of all, with all the gifs that still exist on the net it hardly seems intelligent to remove gif support from GD.
That being said, how do I make dynamic thumbnails of gifs if all I have to work with is GD? Is there a way to suplement with an older library or do I have to completely uninstall my current GD and install the older (I would like to avoid this).
Perhaps someone knows of an algorithm for resizing gifs so I can bypass GD altogether?
That being said, how do I make dynamic thumbnails of gifs if all I have to work with is GD? Is there a way to suplement with an older library or do I have to completely uninstall my current GD and install the older (I would like to avoid this).
Perhaps someone knows of an algorithm for resizing gifs so I can bypass GD altogether?
Imagemagick has support for the .gif format. http://www.imagemagick.org
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Re: gif resize support? Anyone? Anyone?
Well they didn't do it because they wanted to. From http://www.rime.com.au/gd/:bznutz wrote:First of all, with all the gifs that still exist on the net it hardly seems intelligent to remove gif support from GD.
MacThe original GD library allowed developers to manipulate GIF files. It was (and is) open source freeware developed by Thomas Boutell of Boutell.Com, Inc.
As you may or may not be aware, Unisys holds the patents on the LZW compression technology used in GIF files. Despite the fact that they were made open and freely available for several years, and as a result became a de-facto standard, in 1996 (I think) Unisys decided to enforce it's patent.
The result of this is that libraries like GD, which are open source, free development projects, created, basically, out of the good nature of it's original author, could no longer use the GIF format.
As a result, all support for GIF was removed in version 1.6 of the GD library. This is the only correct solution for someone that lives in Canada or the US.
- puckeye
- Forum Contributor
- Posts: 105
- Joined: Fri Dec 06, 2002 7:26 pm
- Location: Joliette, QC, CA
- Contact:
The thing here...
If we un-lzw the gif file do we get anything usable on the PHP stand point? What I mean is that if the gif file is uncompressed could we load the code using imagecreatefromstring? And then use either imagejpg or imagepng?
If we un-lzw the gif file do we get anything usable on the PHP stand point? What I mean is that if the gif file is uncompressed could we load the code using imagecreatefromstring? And then use either imagejpg or imagepng?
There is an ImageMagick extension (imagick) for PHP available on PEAR: http://pear.php.net/package-info.php?pacid=76
It is still in beta, but if you have some time to recompile PHP and add the extension to your setup, you can call many of the ImageMagick library functions directly from PHP. From my experience, ImageMagick still fully supports GIF files, but it does not use the patented compression method.
In a nutshell, this means that the GIFs you output will be much larger. You will likely have better results saving the resized images as PNGs (if you need non-lossy compression), but I don't know your exact situation and requirements.
-db
It is still in beta, but if you have some time to recompile PHP and add the extension to your setup, you can call many of the ImageMagick library functions directly from PHP. From my experience, ImageMagick still fully supports GIF files, but it does not use the patented compression method.
In a nutshell, this means that the GIFs you output will be much larger. You will likely have better results saving the resized images as PNGs (if you need non-lossy compression), but I don't know your exact situation and requirements.
-db