note 21351 modified in function.imagecreatefromgif by cece
| From: | cece@php.net | Date: | Sat, 16 Aug 2003 20:27:43 +0000 |
| Subject: | note 21351 modified in function.imagecreatefromgif by cece | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-54453@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( dirname($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.
--was--
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