Avatar upload and cropping not working

I am using Release - 1.9.7, Version - 2014050600 I am NOT using any addon theme.

Whenever I upload a graphic image for the admin avatar ( I have not tried this on other members yet ) I get the default picture for when a graphic image cannot be displayed. I have tried jpg, gif, and png all with the same result. I have tried a number of different sizes as well. When I have created groups, the upload and display work correctly.

The second issue I will forego for now as it may be resolved when this first issue is resolved.

So, if anyone has an idea as to the problem your assistance would be greatly appreciated.

thank you,


  • Just one mind: browser and (or) OS error :(

    Did you tried to do it via another browsers/OS ? What results?

  • Other browsers work just the same. I can try a different OS next week ( have my own windows server ), but that will not solve the problem it must run on the hosted server it is on.

  • I wouldn't think that any plugin bundled with Elgg would cause this issue - and the profile plugin is a bundled plugin.

    My question was: do you use any 3rd party plugins, i.e. plugins you've added additionally? If this is the case, disable all of these additional plugins but keep the bundled plugins of Elgg enabled. Does uploading of avatars work then? My guess is that disabling the profile plugin only made the uploading of avatars to work because the 3rd party plugin that's really causing the error happened to not interfere with the uploading with the profile plugin disabled. Still, I would think the error is not in the profile plugin but in this other 3rd party plugin that is either buggy or maybe just not correctly working on Elgg 1.9 (maybe it was released for Elgg 1.8 and not updated yet).

    Another possible reason for the failure that just came to my mind: translations. What is the language you've currently set on your site? If it's something other than English then switch the language to English for testing. If the error is in a language file (e.g. saved with wrong encoding) then it might work when using the native language.

  • Hey guys.. i'm new to Elgg.... kinda rusty on my coding (Qbasic was the big program when i last was a coder ;-P )... i had the same issue you did regarding the cropping. I managed to fix it... KINDA. i checked what code i could and went through all the steps you guys have gone through (before i joined) ... what i did notice was it's the RESOLUTION of the file... regardless of the cropping restrictions, the file size is limited to whatever 720x960 ish resolution is (<3mb) if i remember right... that allowed me to display 3/4 of the picture on my profile as my "avatar" and it actually works. Try that.. as additional (and this is a theory) limit the file name also.. 8-10 characters.. i have had issues posting group and social pictures with character names from search engines (101010587mybabygold1837ring.jpg) kinda thing.

    BEST LUCK! i hope you get it figured out... i know the easiest solution is to download a theme that mirrors the base elgg theme and that should solve the problem (did that on my alt site before i got stubborn)

  • I did a fresh install with only the plugins that come with the download. There are no new 3rd party plugins. The language is English. As for filename I have used admin.jpg cannot be much simpler than that. And file size I have tried anywhere from 13kb, 139kb and up. I stated before, it is odd that group pics work fine, however profile pics do not?

  • I'm new to Elgg myself and at first had a problem with the Avatar crop for the profile where it would only show a small section, if that is what you are referring too? I had to click and drag my mouse on the larger picture to select what I wanted to get it right and then it was fine.

  • Have you checked whether the image exists in the datadir?

    If the file is found, open the URL of the image into a new tab. The URL should look something like this: https://yoursite/mod/profile/icondirect.php?lastcache=1420259174&joindate=1420256553&guid=1975232&size=tiny. Then open the file /mod/profile/icondirect.php and debug it by printing out various parts of it.

    E.g print out the filename on line 66 to see whether it points to the file that exists in the dataroot:

    var_dump($filename); die;

  • I did as Juho suggested and placed a die statement after the filename on line 66 and found that I was getting this error: Resource interpreted as Image but transferred with MIME type text/html:

    Now that is very strange to me. Why in the world would I get this error here when if I go to "groups" the images display just fine there but no where else? Why images would display correctly on one page and not another makes no sense to me.

    Any suggestions on how to fix this?

    thank you,


  • In addition to the above when I tried to request the url directly ( http://www.market-demographics.com/mod/profile/icondirect.php?lastcache=1420670298&amp;joindate=1420654885&amp;guid=37 ) the response code was a 404. However, the image is there, so the information in the url request must be incorrect. Since I am new to elgg I have no idea where to go or how to fix this. Your help is appreciated.

  • SOLVED!!!! Unbelievable...the problem is solved by setting the date.timezone in the php.ini file. The php script was actually failing because there was not a default.timezone set. When I set that in the incondirect.php script it worked correctly and it finally dawned on me that it needed to be set in the php.ini file. So by setting it there all the other problems were solved.

    thank you one and all for trying to help.


Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking