News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Uploaded gif avatar loses animation

Started by MothMan, June 08, 2010, 11:04:07 PM

Previous topic - Next topic

MothMan

I've searched the forum, and have seen a few somewhat similar threads, but none have answered my problem.

I'm running 2.0 RC3, and have avatar permissions set to allow only uploaded avatars, with a size limit of 150x200px.

A user has complained that his uploaded gif avatar loses it's animation, even though it is 15x200px in size.

I've confirmed this, and even tried uploading the avatar for him, but again, the resulting avatar is just a dingle frame.

What I've noticed, is it seems that the image, once uploaded, is being converted to a PNG file (which explains the loss of animation).

Why is this happening, and how can I change it?

I've tested with other animated gifs (though much smaller in dimensions) and they work fine.

flapjack

this is a known bug/feature. at the moment there's no solution, but devs are working on it. however, it is confirmed that even when introduced it won't work in all browsers. check wikipedia for "APNG" to see the list of browsers that support this feature

MothMan

Thanks for the info.

Is there any easy explanation as to how the software chooses what gifs to "allow" and what ones to not?  (ie.  some animated gifs work, some don't).

flapjack

at the moment if the gif needs to be resized, it automatically is reduced to the first image of animation. up until now, when you were using SMF to upload your avatar it was automatically converted to PNG loosing everything apart the first frame of the animation.
recently however Nao mentioned that this part of SMF is being rewritten, so keep your fingers crossed :)

tumbleweed

G.C. SOLUTIONS - Hosting Quality Sites Since 2006. Experience Your Forums On A Whole New Level
Elastic Sites Stress Fast CPU/Ram Upgrades- More Info Here.
Reviews By SMF Forum Owners - Read Our Rev

~DS~

Animations does work only with url ink
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

MothMan

The part I don't get is why my forum is resizing the gif though.  It's at 150x200 px, which is what I have set as the avatar size limit.

I even tried reducing it's dimensions in Photoshop and then reuploading, still no good.

I guess I could open up the permissions to allow external avatars, and try that.  Just weird that the avatar upload works for some animated gif's (very small ones I've tried), but not this other one, when it is still below my size limit settings.   :-\

Antechinus

That is odd. Can you give us some examples so we can run them on test sites?

tumbleweed

according to the url I posted:
There are three ways you can achieve resized avatars while keeping the animation.

1) You can specify the URL as Frank pointed out. Once you find an avatar you like, save it and upload it to your server (keep it in an easy-to-reach folder such as www.yoursite.com/myavatars/). In your profile, for the avatar selection, choose Specify avatar by URL and then type the URL to the newly uploaded image (such as http://www.yoursite.com/myavatars/sheep.gif).

2) The other way (and my preferred method) is to save the gif to your computer, then use any graphics program, resize it to match the allowed avatar size on your site, and upload it to your folder. This method requires a bit more work and some basic knowledge of image manipulation, but gives better control over the end product.

3)this was resolved by setting avatar to be resized using javascript in the admin panel. Choosing this option, and then specifying the URL to an avatar, allowed the avatar to remain animated.

G.C. SOLUTIONS - Hosting Quality Sites Since 2006. Experience Your Forums On A Whole New Level
Elastic Sites Stress Fast CPU/Ram Upgrades- More Info Here.
Reviews By SMF Forum Owners - Read Our Rev

Antechinus

The javascript resize is by far the better option (I'm not sure the html resize is worth having) but still, no resizing should be done on images that are less than the set size limits.

tumbleweed

Quote from: Antechinus on June 09, 2010, 01:53:30 AM
The javascript resize is by far the better option (I'm not sure the html resize is worth having) but still, no resizing should be done on images that are less than the set size limits.

yes you are correct no resize if the image is within the limits.
G.C. SOLUTIONS - Hosting Quality Sites Since 2006. Experience Your Forums On A Whole New Level
Elastic Sites Stress Fast CPU/Ram Upgrades- More Info Here.
Reviews By SMF Forum Owners - Read Our Rev

MothMan

Quote from: Antechinus on June 09, 2010, 01:44:26 AM
That is odd. Can you give us some examples so we can run them on test sites?

This is the gif that won't work.


Arantor

It won't work if it's being resized, and possibly additionally being flagged as dangerous (which forces re-encoding anyway), since the GD library in PHP cannot deal with animated images.

I'd note that other forum environments have EXACTLY the same problem because it's a software limitation of the underlying platform, and spending all the effort in writing a new animation widget when, to be honest, you could just host it on Photobucket or something and link it via URL... sort of makes it not worth the effort.

MothMan

I appreciate the responses, but wanted to reiterate that the gif in question (the one posted above) is not being resized.  It's dimensions are smaller than the forums limit (150x200).  Other gif's that are within the size limit seem to work fine.

Is there a file size (ie. kb) limit set somewhere I don't know about?

Regardless, it appears the only way to get this gif to work will be to open up external avatars.

Arantor

If it's triggering the unsafe attachment filter, the ONLY way will be external avatar because it will always be re-encoded. But to be fair, it's a bug in a pre-release version of SMF 2.0...

MothMan


Antechinus

Cool. Got a couple of ones that do work? It would be interesting to analyse the differences.

MothMan

Well, as an example, I just grabbed a random gif from a Google search, and the following gif works fine as an uploaded avatar:

http://www.animatedgif.net/cartoons/A_5odie_e0.gif

I also tried this one:  http://www.animatedgif.net/cartoons/3dsub0_e0.gif  and it failed.

So, I'm thinking it's a file-size issue??

Arantor

I doubt it's filesize, since the one that doesn't work is under 100K.

I still think it's falling foul of the zealous anti-malicious check in files.


.Vapor

Another way around this is to :

1. Create a sub gallery
2. Upload the desired avatar to it
3. Choose it via the user cp

DMR123

I know this topic is 2 years old, but Im having the same problem, and instead of creating a new topic ill just reply here..


I have created some animated gifs, yet they work in the browser, but not when I upload them as an avatar.

I have disabled autoresizing to PNG, yet it still doesnt work..

Any more info on this?

aksal

Ten years later this issue still persists. And this not only for the avatars.

Kindred

As stated previously...  it's not the uploaded gif that is the problem.

It's when you upload a gif that has to be resized. This will cause the gif to lose animation.
This is not, technically, an SMF bug....  it's an issue with the server side graphics handling tools.
It resizes the gif and saves just the first frame of the animation.

Solution 1- don't allow uploaded avatars to be resized.
Solution 2- don't allow uploaded avatars.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: