Server issue Animated Avatars

x4rl

Well-known member
Howdy.

On my test site I have attachments limit set to 10mb and the size show when uploading is 200x200px

Ive just uploaded a Gif file and it does not move (as in no animation)
I even tried to upload it though the admin panel editing the user with the same result.

I also tested a smaller image (less than 200x200) and it worked fine.

I also get no errors so can't provide one.

To reproduce just upload a 200x200 animated Gif image.
 
To maintain animation with resized images, you need to use ImageMagick as your image processor. GD doesn't support animation.
 
The smaller ones don't get resized at the "full" size. (The full size is actually 192 max width.)
 
Mike when uploading a a gif not as an avatar but on a post does imagemagick make the thumb?
Also when uploading a none gif with imagemagick selected as the default image processor does GD make this thumb?
 
Whenever a image needs to be processed (resized, etc) for any reason, your selected image processor is used.
 
Whenever a image needs to be processed (resized, etc) for any reason, your selected image processor is used.
Than I think I have some problem here.
Any image other than a Gif will work fine but if I upload a Gif it get's stuck on 100%
Hlh6j2s.jpg
 
It's possible there are issues with ImageMagick, but equally, this is one of the tradeoffs. If you resize an animated image, it's like resizing a large number of images (each frame is resized), so it can trigger timeouts/memory issues more easily.
 
No, not explicitly. Though note that you'd only possibly see the animated version on the profile (if you use GD).
 
I'll have a look into it than. On a off note is there a way to disable animated avatars all together?

What I have done on my forum is disable uploading of .gif for avatars.

You can make a simple hack in the core file like this:

library/Xenforo/Model/Avatar.php

this hack prevents gif's from being uploaded as an avatar.

Line 59

Original code
=============
PHP:
if (!in_array($imageType, array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG)))
{
    throw new XenForo_Exception(new XenForo_Phrase('uploaded_file_is_not_valid_image'), true);
}

Hacked code
===========
PHP:
if (!in_array($imageType, array(IMAGETYPE_JPEG, IMAGETYPE_PNG)))
{
    throw new XenForo_Exception(new XenForo_Phrase('uploaded_file_is_not_valid_image'), true);
}
 
Top Bottom