note 21351 added to function.imagecreatefromgif
| From: | senbei at terra dot es | Date: | Thu, 09 May 2002 14:31:03 +0000 |
| Subject: | note 21351 added to function.imagecreatefromgif | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-30381@lists.php.net to get a copy of this message | ||
Since gif support is removed from the more recent GD libraries, you can still use it via an external
program.
I've read somewhere about using ImageMagick and I tried myself but it's a quite big
package and needs the X11 libs which are not available in some servers.
The other option I found is to use a little prog "gif2png" http://www.tuxedo.org/~esr/gif2png/
to convert gif files to png ones. It works under Unix and dos/win32/winnt and is very
straightforward.
If you need to modify an user uploaded gif file to save it into your site just use this:
$path=$_FILES["photo"]["tmp_name"];
passthru("/usr/bin/gif2png -d -O ".$path);
$src_img=imagecreatefrompng( basedir($path)."/".basename($path,
".gif").".png");
This will convert the gif to a png and delete the gif file, then it will open the png with the GDlib
so you can perform any operation on it.
--
http://www.php.net/manual/en/function.imagecreatefromgif.php
http://master.php.net/manage/user-notes.php?action=edit+21351
http://master.php.net/manage/user-notes.php?action=delete+21351
http://master.php.net/manage/user-notes.php?action=reject+21351