gif 2 jpg conversion
Moderator: General Moderators
gif 2 jpg conversion
Is it possible to convert gif image in to jpg image on the fly using GD library
Moeed
Moeed
Yes! This is easy!
Here is a code for doing this:
converts asc.gif in asc.jpg
Code: Select all
<?php
$imgfile="asc.gif";
$image=imageCreateFromGIF($imgfile);
imageJpeg($image, "asc.jpg");
@imagedestroy($image);
?>Thanx for the reply. I have used the code supplied by u but it produces an error whih is given below. Can u please figure out problem.
Thank You
Moeed
Code: Select all
Warning: ImageCreateFromGif: No GIF read support in this PHP build in c:\apache\htdocs\convert.php on line 3
Warning: Supplied argument is not a valid Image resource in c:\apache\htdocs\convert.php on line 4Moeed
:(
What can I say... try installing new PHP version or GD library...
- gite_ashish
- Forum Contributor
- Posts: 118
- Joined: Sat Aug 31, 2002 11:38 am
- Location: India
From PHP Manual -
"Versions of GD older than gd-1.6 support GIF format images, and do not support PNG, where versions greater than gd-1.6 support PNG, not GIF."
"GIF - Only supported in GD versions older than gd-1.6. Read-only GIF support is available with PHP 4.3.0 and the bundled GD-library."
You can check your PHP install details using:
<?php
phpinfo();
?>
and look for word/section - gd
"Versions of GD older than gd-1.6 support GIF format images, and do not support PNG, where versions greater than gd-1.6 support PNG, not GIF."
"GIF - Only supported in GD versions older than gd-1.6. Read-only GIF support is available with PHP 4.3.0 and the bundled GD-library."
You can check your PHP install details using:
<?php
phpinfo();
?>
and look for word/section - gd
Funny...
Funny thing...
I have PHP v. 4.1.2. and GD2 and can read GIF, read&create PNG...
:\
I have PHP v. 4.1.2. and GD2 and can read GIF, read&create PNG...
:\
- gite_ashish
- Forum Contributor
- Posts: 118
- Joined: Sat Aug 31, 2002 11:38 am
- Location: India
due to compuserve's new owners getting picky and wanting royalties youhave to get a third party add in to do more than read. read is still open to everyone. anything more and you now have to pay royalties.
therefore it was dropped in versions newer than 1.6
many hosts will get third party add ins so you can still do stuff though, so check with your host.
therefore it was dropped in versions newer than 1.6
many hosts will get third party add ins so you can still do stuff though, so check with your host.