Page 1 of 1

Animated GIF Resize problems on shared hosting using IM

Posted: 2013-03-04T18:54:48-07:00
by Lysium
Hey guys, I have a wordpress site that used wordpress' default resizing for pictures and at the moment all animated gifs that are retained still keep their animations which is severely lagging my site. How exactly can my host, hostgator disable the retention of a gif's animation once it is resized without affecting other customers on the same shared hosting server.

Thanks guys, hope someone can provide a solution.

Re: Animated GIF Resize problems on shared hosting using IM

Posted: 2013-03-04T19:10:49-07:00
by fmw42
I for one do not really understand what the issue is. Can you explain a bit further what the operations are the you are doing and where it is continuing to process to slow down the server? What exactly is your resize command for your animated gifs? Are the gifs large in dimensions as well as numerous frames? If so, then IM, I believe will try to put the whole gif into memory as well as the ouput and any intermediate copies it needs. You may be running out of memory? You can follow these instructions to use less memory, but slow down your processing by using more disk space. That may help with the server loading. see http://www.imagemagick.org/Usage/files/#massive and http://www.imagemagick.org/script/resou ... nvironment

If I misunderstand, please clarify and point me in the right direction as to what the problem is?

Also what version of IM and what platform?

Re: Animated GIF Resize problems on shared hosting using IM

Posted: 2013-03-04T19:42:17-07:00
by Lysium
Wordpress 3.5.1 uses ImageMagick as it's default method of resizing pictures.

I am simply running a theme through wordpress which allows users to upload and share pictures with other members of the site. What is happening at the moment is that some users are uploading 10 animated gifs at a time so when you go to a user's gallery you can see the thumbnails of their uploads (thumbnails that are resized still retain their animation which is the issue at hand), so just imagine about 20 animated gifs loading at the same time, it really slows down users who are browsing galleries and etc.

When I was referring to my site slowing down I was simply referring to the fact that these animated gifs still retain their animations even after being resized by ImageMagick and the only solution I can think of right now is to find out how to disable ImageMagick retaining the gif animations after resizing so I can proceed to tell my host how to do it. I am using the default wordpress features for image resizing so I do not have any option on my end to disable the retention of animations when an animated gif is resized.

Sorry if this will still confusing. I've been frustrated about this for a few days as well so I am just getting even worse in explaining myself.

Re: Animated GIF Resize problems on shared hosting using IM

Posted: 2013-03-04T20:14:22-07:00
by fmw42
If you want to make a resize of the just the first frame of the animation and display that rather than the resized animation, the IM command would be

convert animation.gif[0] -thumbnail animation_frame_thumbnail.gif

If that is not the issue, the clarify further. What is still running that is slowing things down? Is it just the process of resizing numerous animated gifs or is it that some gifs are actually still animating somewhere that you want to disable?

Re: Animated GIF Resize problems on shared hosting using IM

Posted: 2013-03-04T20:25:23-07:00
by Lysium
The problem is the latter, the fact that all thumbnails of animated gifs are still retaining their animation which becomes an issue for the users that are browsing my site. There is no actual issue with the process of resizing the images and etc.

Re: Animated GIF Resize problems on shared hosting using IM

Posted: 2013-03-04T20:41:53-07:00
by fmw42
Do you have to show animated thumbnails? Why not just create a single frame image thumbnail and display that. If you must create animated thumbnails, then set them to repeat a limited number of times or just once. Or only when clicked. Are any of these ideas practical for your site?

In IM, you can tell the animation to loop a given number of times with -loop N

Re: Animated GIF Resize problems on shared hosting using IM

Posted: 2013-03-04T20:50:23-07:00
by fmw42
Perhaps I still misunderstand. If a user uploads an animated gif (file), it does not animate until it is sent back to the user's browser. Same for any resized animation. Once IM finishes resizing it, it does not animate. The file will be sent to the user's browser to animate and that will not put any load on the server other than the resizing process.

What am I missing about your situation?

Re: Animated GIF Resize problems on shared hosting using IM

Posted: 2013-03-04T21:30:48-07:00
by Lysium
From the wordpress back end i cannot disable the animations for the resized thumbnails - so I must ask the host of my shared hosting account to help me set something through ImageMagick.

Okay, let me clarify, there is no issue with server load, processing or whatsoever, it is simply the fact that I do not wanted resized images to have animations at all because my users are experiencing lag on their end because their computers may be slow and etc. and cannot handle a large number of animated images on a single page. So the only solution would be to have ImageMagick create thumbnails that do not retain the animation of the main image, so my users do not experience any lag and etc.

Re: Animated GIF Resize problems on shared hosting using IM

Posted: 2013-03-04T21:33:55-07:00
by Lysium
This is an example of the problem that I am having, however I have to warn you that this is a semi-adult site so there may be images that may offend. But anyways, here is a link http://azngirls.com/pin/283/ - On this page you will see the main image that is animated. However, the 2 smaller resized images on the left side bar still retain the animation - So if a user uploads 20 gif animations any user who views their gallery will have to load all the animated thumbnails as well.

Re: Animated GIF Resize problems on shared hosting using IM

Posted: 2013-03-04T22:51:57-07:00
by fmw42
IM cannot turn an animation off once it is sent to the user's browser. You can remake the animation of the thumbnails so that they only run a limited time.

convert animation.gif -thumbnail -loop 2 animation_thumbnail_loop2.gif

Or just use this IM command to make a thumbnail of the first frame of the larger animation.

convert animation.gif[0] -thumbnail animation_frame1_thumbnail.gif

or get the first frame of the animation and make a thumbnail from it

convert animation.gif[0] animation_frame1.gif
convert animation_frame1.gif -thumbnail animation_frame1_thumbnail.gif