MyBB Community Forums

Full Version: Built-in avatar resize freezes Animated GIFs?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I see the options to upload an avatar from a file, or to enter a URL and still upload.

How do I give the users the option of simply entering a URL as their avatar, and the boards pull it from that URL instead of uploading it to my server? Will save a lot of space and such... I'm guessing I just don't see it, or don't know the exact wording to call it. If it's a plugin, what's the name of the plugin?
Perhaps try the gravatar plugin - it does require your users to have a gravatar account though.
I'm not familiar with Gravatar or what that is but I wouldn't use it if it requires users to make an extra account. I'm leaning toward the belief that this is something that probably can be done in options somewhere, but I just don't know how. Or, perhaps it's a simple plugin that I can't find via search because it has an unusual name? On other forums you can put in a URL as an avatar and the forums use that URL as the source for that avatar instead of uploading so this is a pretty basic and expected feature, I believe.

With concerns of uploading/sizes, etc... I'd imagine a lot of people before me wondered how to put an avatar as simply an external link. What solution is used when this comes up?
Well, gravatar is like a universal avatar - I use it because a lot of Wordpress sites use it - it is not just MyBB. This way when I post on a blog IF they have gravatar support I get my avatar.

But - just to "hotlink" an image - that is already in MyBB - in the change avatar option in User CP then you can choose to put an url - and that is your avatar. That is the bottom option.

https://en.gravatar.com/
User uploaded avatars will take up a very negligible amount of space. I don't think this has ever been brought up before because it's a non-issue for most people. This method is better because even if for some reason the external host fails, the avatar will still load since it is hosted locally.
I guess I should mention one of the other reasons I asked. It was because I think the user should have the option, but also because of an actual problem with the current method.

When I have a maximum avatar size set, and a user tried to upload an animated GIF (that fits within the KB/filesize requirement just fine) but the GIF pic is physically too wide (or tall)... it has an option to auto-resize but the problem is that it freezes the pic.

In other words it only displays the 1st frame of the animated GIF once it's resized.

See... in other boards where you can just tell it to source the image from an already existing URL (and keep it that way) then those larger GIFs would be shrunk down automatically by the "width" command rather than literally having their FILE resized and frozen.

This is why I asked if there's just a way to use the URL and keep it the original URL... because I bet fixing the resize/freeze problem is a bit more complicated. lol

I noticed there are sites like this (http://resizepic.com/) which automatically CAN resize an animated GIF and keep it animated. They also let you view the resized image AND right there on the fly you can enter a different width/height and then click "resize again" and it instantly appears resized until you're sure it looks right.

Is there perhaps an answer that already has been found for this problem? If so, please point me to it. If not, can you guys (developers) switch the built-in resizing mechanism on myBB to stop freezing animated GIFs?
You'd have to change code (functions_upload.php::upload_avatar()) to make it stop resizing GIF images (which is what breaks the animation, as PHP's GD library does not support animated GIF). And then hope it'll specify the avatar size anyway so the browser can display it resized.
IIRC, if you enter an URL, it's hotlinked. MyBB fetches the URL to verify the size/dimension constraints, but after it's happy with that, it just lets it be hotlinked (even if the dimensions/size changes afterwards).
Unfortunately won't solve the issue of animated GIFs; you could just set a very large maximum avatar size and then a lower display dimensions size, though it may not be what you want.