note 82912 added to function.imagecreatefromgif
| From: | maxlloyd at osu1 dot php dot net | Date: | Thu, 01 May 2008 16:08:21 +0000 |
| Subject: | note 82912 added to function.imagecreatefromgif | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-138969@lists.php.net to get a copy of this message | ||
Someone wanted to display only the first frame of an animated .gif
I thought maybe if the animated .gif was displayed
as a .png, it would only display the first frame.
This worked very good:
The HTML used to display image:
<img src="giftopng.php?image=mypic.gif" alt="" />
The test script called: "giftopng.php"
<?php
//Get image name from URL
$image=$_GET['image'];
//Load the image
$img = ImageCreateFromGif($image);
//Convert to PNG and send it to browser
if($img) {
header("Content-Type: image/png");
ImagePNG($img);
//Clean-up memory
ImageDestroy($img);
}
?>
----
Server IP: 64.71.164.2
Probable Submitter: 192.28.2.45
----
Manual Page -- http://www.php.net/manual/en/function.imagecreatefromgif.php
Edit -- https://master.php.net/note/edit/82912
Del: integrated -- https://master.php.net/note/delete/82912/integrated
Del: useless -- https://master.php.net/note/delete/82912/useless
Del: bad code -- https://master.php.net/note/delete/82912/bad+code
Del: spam -- https://master.php.net/note/delete/82912/spam
Del: non-english -- https://master.php.net/note/delete/82912/non-english
Del: in docs -- https://master.php.net/note/delete/82912/in+docs
Del: other reasons-- https://master.php.net/note/delete/82912
Reject -- https://master.php.net/note/reject/82912
Search -- https://master.php.net/manage/user-notes.php