Welcome Guest, Not a member yet? Register   Sign In
resize animated gif?!
#1

[eluser]M A F I A[/eluser]
Hi,

Can you help me to resize an animated gif to a little size? (tumbnailing with PHP)
I want to have an animated gif after resizing...

Regards,
David Gates.
#2

[eluser]Pygon[/eluser]
Good luck -- I don't think GD supports this (atleast not in PHP). You might look at the ImageMagik library and a custom class but I don't believe there are any functions for resizing animated gifs.
#3

[eluser]Base Willy[/eluser]
ImageMagick can easily do that Smile
#4

[eluser]M A F I A[/eluser]
ImageMagick?

I hadn't worked with this. Can you give me a PHP code to do that?
(I'm sorry for my VERY BAD English lang.)
#5

[eluser]Base Willy[/eluser]
MAFIA, http://imagemagick.org/script/index.php
#6

[eluser]M A F I A[/eluser]
Thank you Base Willy,
Found This on IM forums:
Quote:Hi,

First of all you have to take the total images in that animated gif and have to resize each image in the sequence in following manner:

for($i=0;$i<=$loop;$i++)
{
MagickSetImageIndex($mgck_wnd,$i);
//$mgck_wnd=MagickTransformImage($mgck_wnd,null,$geometry);
MagickScaleImage($mgck_wnd,$width,$height);
}
Can you test this and tell me what happened?

My server doesn't support IM.
Can you introduce me a free webhosting that support IM?
I want to see if this is my answer, change my webhosting.
#7

[eluser]Base Willy[/eluser]
You're welcome.
With image magick you can resize an image with one simple command, like exec("convert big_image.gif -resize 50x50 small_image.gif"), and it will keep the animation.
Sorry but I can't suggest you any hosting with IM because I don't know any and got used to use my own serverSmile So you gonna have to find it yourself.
Good luck!
#8

[eluser]M A F I A[/eluser]
Thank you.

I found 110mb.com.
It support IM, But exec() function has disabled for security reasons.
Is there any way to do that?
Here is the page that I used that code:
http://bacheteroon.110mb.com/IM.php
#9

[eluser]Base Willy[/eluser]
The other way is using php extension to work with IM but I don't know if it's installed there and haven't worked with it, command line is easy enough.
#10

[eluser]M A F I A[/eluser]
Can you give an example to me?
Or...
Can you test this code on your own server and send me the result in the browser in a zip file with images and html?

Code:
&lt;?PHP exec("convert image.gif -resize 234x30 img.gif"); ?&gt;
<img src="image.gif"><br><img src="img.gif">
The image is here: http://bacheteroon.110mb.com/image.gif

Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB