Create gif images using GD

Is it possible to create gif images using GD

Page 1 of 1

1 Replies - 10265 Views - Last Post: 06 June 2008 - 02:45 AM Rate Topic: -----

#1 silverblaze  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 69
  • Joined: 18-January 08

Create gif images using GD

Posted 05 June 2008 - 12:07 PM

Hello all,

i am currently working in a small scale project for my a client. He is only having a shared server which supports GD only. In this site i want to make a gif images from a set of jpg or png images. Is thier any way to create that. I know how to make display gif images and even i know how to do what i want usng imagemagik. but unfortunatly my clients server doesnt support imagemajik (more over im nt tht much confident in imagemajik as i had only worked with it twice).

Any ref or advice will be greatly appriciated.

thankyou.

Is This A Good Question/Topic? 0
  • +

Replies To: Create gif images using GD

#2 silverblaze  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 69
  • Joined: 18-January 08

Re: Create gif images using GD

Posted 06 June 2008 - 02:45 AM

hello all,

after much research i found the class attached with this post using which i can create gif images. bt the problem i was facing was tht i want to convert jpg images into gif nd gif to animated gif.
Then i made some minor work and now its working fine.

here is hw i did it

<?php

	include "GIFEncoder.class.php";
	
	for($i=1;$i<6;$i++){
		$imgname = "images/".$i.".jpg";
		$im = @imagecreatefromjpeg($imgname); /* Attempt to open */
		imagegif($im, "images/".$i.".gif");
		$frames[] = "images/".$i.".gif";
		$time[] = 200; 
	}
	
		$gif = new GIFEncoder	(
								$frames, // frames array
								$time, // elapsed time array
								0, // loops (0 = infinite)
								2, // disposal
								0, 0, 0, // rgb of transparency
								"url" // source type
			);

// display the image
Header ( 'Content-type:image/gif' );
echo	$gif->GetAnimation ( );

	for($i=1;$i<6;$i++){
		@unlink("images/".$i.".gif");
	}
	

?>


here wht i did is, first i convert the jpg images into gif, thn make the gif and thn delete the gif.

im posting this solutions hoping others with similar problem can solve it easily.

thankyou.

Attached File(s)


This post has been edited by silverblaze: 06 June 2008 - 02:46 AM

Was This Post Helpful? 1

Page 1 of 1