XF 2.1 Maximum file size for avatars

slothly

New member
Is there a way to modify the maximum file size in bytes for the avatars? It seems 1MB is the limit and we'd like to raise that.

I've already tried modifying my php.ini file to expand the limit but that didn't seem to do anything.

Alternatively, is there a way for users to provide their avatars with a direct URL instead of uploading it? (if there's an add-on for that, please let me know!)

Thank you
 

slothly

New member
Is there a way for users to provide a dynamic link for their avatars instead of uploading it? I am aware of the system where the avatars are uploaded into LQ and HQ formats, but I don't need this for my forum and would like to circumvent it if possible.

Someone on my forum who's active on another forum running on xenforo mentioned that they have the option to provide a link for their avatar without having to worry about file limits. I've looked around for a possible plug-in to accomplish this but I can't find anything.

Any help would be greatly appreciated. I've been trying to figure out a solution to this issue for a month now and can't find any solutions.
 

Brogan

XenForo moderator
Staff member
There is no option for uploading an avatar via a URL.

You can enable Gravatar support should you wish, which will automatically pull avatars for those who have a Gravatar account.
 

slothly

New member
Still trying to find the answer to this

GIF avatars over 1mb don't work. If it's under a certain file size, it'll animate.

Is there a way to modify this file size limit for GIF avatars?
 
Last edited:
I'm really not enjoying how every single one of my posts is getting deleted only because you guys can't seem to figure out something that should be very easy to. There was absolutely no inappropriate language in my post, not a single insult or derogatory remark made to anyone in person.
 
Last edited by a moderator:

Chris D

XenForo developer
Staff member
Often times you can elicit the response you require by replying with some dignity and being polite.

As a specific example:
HELLOOOOOO.

Stop ignoring us only because we're gay, that's homophobic.
Not only does this post start out rather rudely, you go on to cause immense offense to everyone who may be reading by claiming that we're not helping because we are all prejudiced against a specific group of people.

Now, first of all, I'm not sure what would give you the impression that we would even know whether you're gay or not. I had no idea until I viewed the message that we rightly deleted for being obnoxious. Secondly, even if you are gay, I'm not sure how that factors into anything in the slightest.

The second post was deleted because it was, again, quite obnoxious, but it also had some rather odd NSFW references to self-gratification that isn't appropriate for the customers on this forum.

This isn't the way to get support.

If you require a response from a member of staff then you would need to submit a ticket. Otherwise, the lack of response on here may simply mean that no customers have anything further to add.
 

Chris D

XenForo developer
Staff member
Still trying to find the answer to this

GIF avatars over 1mb don't work. If it's under a certain file size, it'll animate.

Is there a way to modify this file size limit for GIF avatars?
There is no hard upload limit for the file size of avatars. Any size should work as long as PHP and the web server is configured to handle uploads of that size. PHP seems to be configured correctly, based on your screenshot, but sometimes there are web server values and other configurations that can override this.

However, the other issue with animated GIF files is that each GIF would have to be split into each individual frame, each frame would then need to be individually resized, and this process happens four times (four different avatar sizes).

With that in mind, resizing of animated GIFs can be a memory and processor intensive operation that can fail on some servers.

You haven't provided the exact details of any error messages or other symptoms of the avatar upload failing so we'd really be unable to comment further on the cause unless that was clarified.
 
I can't speak for all specific details but sometimes all I get when uploading an animated avatar is following error message:

"Oops! We ran into some problems. Please try again later. More error details may be in the browser console. "

One time, however, I got a more specific error that might be more helpful, although @slothly might have more details about this:

ImagickException: Optimize image layers failed in src/XF/Image/Imagick.php at line 242
  1. Imagick->optimizeimagelayers() in src/XF/Image/Imagick.php at line 242
  2. XF\Image\Imagick->save() in src/XF/Service/User/Avatar.php at line 254
  3. XF\Service\User\Avatar->updateAvatar() in src/XF/Pub/Controller/Account.php at line 466
  4. XF\Pub\Controller\Account->actionAvatar() in src/XF/Mvc/Dispatcher.php at line 321
  5. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 248
  6. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 100
  7. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 50
  8. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2177
  9. XF\App->run() in src/XF.php at line 390
  10. XF::runApp() in index.php at line 20
 

Chris D

XenForo developer
Staff member
If you get the "Oops" error message, it might be worth checking in the browser console.

Is it something that happens nearly instantly or after a period of time? Timeouts could be problematic, especially for GIFs with lots of frames.

The "Optimize image layers failed" message may actually be indicative of a bug in ImageMagick or the Imagick extension. It might be worth seeing if these can be updated on the server as they can sometimes fix unexplained issues.
 

BirdOPrey5

Well-known member
Increasing the PHP memory limit has helped me with resizing larger images in the past. Push it to the max you can, see if it starts working, if it does, you can reduce it again until you hit a spot where it works for the majority of images you think will be resized. Understand some gifs may simply be too big to be resized in this way.
 
Top