News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Avatars sometimes load then disappear

Started by jamescormack, August 24, 2009, 10:16:32 AM

Previous topic - Next topic

jamescormack

Hi guys,

Just another issue on my site economicate.org . For me at least, the avatars displayed in people's posts and avatars sometimes disappear shortly after loading; other times they remain visible.

I am using Google Chrome, in case that may be causing it.

I had a quick look around but couldn't find a fix for this. Any suggestions would be greatly appreciated.

Thanks
James

Norv

What version of SMF do you have?
Please take a look here, just to be sure: http://www.simplemachines.org/community/index.php?topic=313201.0
and run the tool attached to it on your forum. Please report the results here.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

jamescormack

#2
Quote from: Norv on August 24, 2009, 10:24:09 AM
What version of SMF do you have?
Please take a look here, just to be sure: http://www.simplemachines.org/community/index.php?topic=313201.0
and run the tool attached to it on your forum. Please report the results here.

Okay, will do, brb.

(I first installed 1.1.10, then updated to RC1.2, but am currently emulating RC1.1 for a few packages.)

jamescormack


Norv

Okay. Then, can you please try shortly with another browser, see if it happens? Google Chrome is reported to have some bugs.
Also, is there anything in your forum error log?
And, please tell what you mean by "avatars sometimes disappear shortly after loading"?
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

jamescormack

Quote from: Norv on August 24, 2009, 10:45:13 AM
Okay. Then, can you please try shortly with another browser, see if it happens? Google Chrome is reported to have some bugs.
Also, is there anything in your forum error log?
And, please tell what you mean by "avatars sometimes disappear shortly after loading"?

Hi Norv. My internet explorer was failing on me so I installed firefox and had a go.

Currently it looks to be fine on firefox: I would put this down as a google chrome error.

By "avatars sometimes disappear shortly after loading" I mean the following:
- Click to open a thread
- The whole page renders, including the avatars to the left of the forum posts
- Once the avatars have fully appeared, sometimes they will remain in place, as normal. But other times, they will 'disappear', and any text and images intended to be below the avatar (such as the "view profile" and "email" buttons) shift up into its place.

There is nothing in my error log relating to this issue.



I will be sure to post here if I find this error occurs in firefox; otherwise, I would consider this a google chrome issue.

Thanks very much for the assistance.

Arantor

Which version of Google Chrome were you using? I use Chrome as my main browser and haven't encountered this.

jamescormack

Quote from: Arantor on August 24, 2009, 11:33:49 AM
Which version of Google Chrome were you using? I use Chrome as my main browser and haven't encountered this.

Hi Arantor, I appear to be/have been using 2.0.172.43 .

My site is http://economicate.org ; you could visit I suppose and see if you experience this? I'm wondering if it's unique to the theme I'm using - "Headline"

Norv

Actually it may be very relevant to know if you are experiencing the issue on the default theme.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

sarahnev

I'm having the same issue. I'm using the same version of Chrome, and SMF 1.1.10 with a modified Classic theme.
Thanks :)

sublimeCAT

i've got the same problem in my forum and some members who use chrome also have it.
the problem remained even after I updated the forum to the RC 2.1 and after upgrading to chrome beta...
[nofollow]

Norv

Please, if you have these symptoms, make sure first of all that you do run the tool provided here:
http://www.simplemachines.org/community/index.php?topic=313201.0
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

sublimeCAT

Quote from: Norv on September 17, 2009, 11:06:26 AM
Please, if you have these symptoms, make sure first of all that you do run the tool provided here:
http://www.simplemachines.org/community/index.php?topic=313201.0

Hi,

I just ran that tool and my forum was clean of infections.
[nofollow]

Norv

Can you please give a little more details on the problem, like when does it appear, is there something relating the users that have it, do the same avatars "appear" again?
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

sublimeCAT

It's like jamescormack described, they load and then they just disapear...
It's a random thing, for each thread you open, random user avatars disappear, usualy 3 or 4 per page.

For instante, I open thread "A" and for example the avatars from users "X", "Y" and "Z" disappear. And then I open thread "B" and those missing avatars may load and other user avatars disappear.
It's just random...
[nofollow]

Norv

Can you please provide a link to your site and a test account (simple member account with the right to read threads), for us eventually to see the problem?
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

sublimeCAT

#16
sure!

My forum is at this url: slacker******.eu/forums/
(the word filter edited my url, it's slackerb_tch with an "i")

You can use this account:
username: SMF
password: pass1234

Thank you for your help
[nofollow]

sublimeCAT

#17
I just noticed that this only happens when in the avatars settings for external avatars the option "resize it with javascript" is activated.

Right now i chose the setting "let the HTML resize it" and it's fine, but it seems it's an itsy bitsy slower to load the pages.
[nofollow]

sarahnev


Arantor


Norv

sublimeCAT: that may be because of errors on the page. (javascript errors). Perhaps checking the error console ("Tools" menu in browsers like Opera and Firefox) would help identifying them.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

rgecy

What is the latest on this issue?  I am having users say they can't upload avatars, or they show up as a blank box with an x, or they appear sometimes, and then disappear.

I have also noticed that the "My Images" in the Ultimate Profile is doing this.  If you go to upload an image, it will either not show or show with an x.

I have not had any issues as admin getting mine to upload, but logged in as regular member and had issues.  Aslo had issues logged in as admin and went into another users account to upload avatar and problem occurred.

I am running 2.0RC1.2 with a modified default theme.

What can I do to help diagnose this problem?

Thanks,

RGecy

rgecy

Any help with this?  I am starting to see more and more users avatars not loading.

I noticed this error in the log.

Database Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '}profile_pictures
WHERE id_member IN (723)' at line 2
File: /home/content/r/g/e/rgecy1/html/forums/Sources/Subs-Members.php
Line: 386 


Here is the code:
Quote366:       DELETE FROM {db_prefix}profile_comments
367:       WHERE comment_member_id IN ({array_int:users})',
368:       array(
369:          'users' => $users,
370:       )
371:    );
372:    $smcFunc['db_query']('', '
373:       DELETE FROM {db_prefix}profile_albums
374:       WHERE id_member IN ({array_int:users})',
375:       array(
376:          'users' => $users,
377:       )
378:    );
379:    $smcFunc['db_query']('', '
380:       SELECT id_picture
381:       FROM {$db_prefix}profile_pictures
382:       WHERE id_member IN ({array_int:users})',
383:       array(
384:          'users' => $users,
385:       )
==>386:    );
387:    
388:    require_once($sourcedir . '/Profile-Pictures.php');
389:    while ($row = $smcFunc['db_fetch_assoc']($request)) {
390:       delete_picture($row['ID_PICTURE']);
391:    }
392: 
393:    // Make their votes appear as guest votes - at least it keeps the totals right.
394:    //!!! Consider adding back in cookie protection.

Thanks,

RGecy

Norv

rgency can you please tell if it happens with the workaround indicated above:
Quote from: sublimeCAT on September 24, 2009, 11:42:41 AM
I just noticed that this only happens when in the avatars settings for external avatars the option "resize it with javascript" is activated.

Right now i chose the setting "let the HTML resize it" and it's fine, but it seems it's an itsy bitsy slower to load the pages.

Also, can you please run the tool provided at http://www.simplemachines.org/community/index.php?topic=313201.0 just to be sure?

Please consider telling a link to your forum, as well, with a test account (normal user account), perhaps we can take a look and notice something of relevance.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Arantor

Edit line 381.

It should not read:
FROM {$db_prefix}profile_pictures

But must be:
FROM {db_prefix}profile_pictures

rgecy

OK, I edited line 381.  Got rid of the error in log, but I still cannot get the avatars to display correctly.  The resize has no affect on my issue.

Here is one that keeps giving me problems.  I went into the users Profile and uploaded his avatar.  When I click Change Profile it refreshed and did not show his avatar and would not show in his profile on post.

Then, I went to Profile Summary, which is Ultimate Profle, and the avatar showed up.  Then I went back to Forum Profile and it was there.  And it is showing in profile under post.  ??? ??? ???

Robert

Norv

Missing the picture first time only, I wonder if it might be because of the browser cache, or simply having a difficulty loading it for the moment...
Can you have it happen again, is there some sort of pattern, though?
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

AtlantaSteve

One of my users is experiencing this very issue.  His avatar disappears after first loading.  It only happens with this user who has his avatar hosted offsite, with a size that is larger than the max sizes we have defined, and it happens during javascript Resizing.

So, I debugged and discovered the lines of code where this is happening.

in script.js, in the function smf_avatarResize:


var tempAvatar = new Image();
tempAvatar.src = possibleAvatars[i].src;

if (smf_avatarMaxWidth != 0 && tempAvatar.width > smf_avatarMaxWidth)
{
  possibleAvatars[i].height = (smf_avatarMaxWidth * tempAvatar.height) / tempAvatar.width;
  possibleAvatars[i].width = smf_avatarMaxWidth;
}
else if (smf_avatarMaxHeight != 0 && tempAvatar.height > smf_avatarMaxHeight)
{
  possibleAvatars[i].width = (smf_avatarMaxHeight * tempAvatar.width) / tempAvatar.height;
  possibleAvatars[i].height = smf_avatarMaxHeight;
}
else
{
  possibleAvatars[i].width = tempAvatar.width;
  possibleAvatars[i].height = tempAvatar.height;
}


When I stepped through the code, everything worked perfectly.  The debugger stepped into the first if block (as it should have) resized his image correctly, and Bob's your uncle.

But when I removed all breakpoints and reran it, again his avatar disappeared.

So I placed a breakpoint on the first line of each of the if/else blocks and found that when it ran without pausing, it was dropping into the last block (Where it just reassigns height/width from tempAvatar), but that the height and width were the actual image's size.  So again, the image didn't disappear.  Weird.

Then I removed all breakpoints, and set a new one at the END of the last else block.  And when I did that?  It broke.

So I dug and figured out what's going on here.

The second line in my code block above (where tempAvatar.src is set) tells the browser to load the image into this in-memory Image object, and then tries to get the width and height values.  However, the javascript engine is not stopping to wait for the image to load, and for those values to be filled correctly.  When I debug, since the engine is running one line at a time, the "halt" gives the loader time to finish loading the image, and correctly fill out those values, but as long as the engine is unencumbered by the debugger, it doesn't fill those values, so height and width on tempAvatar still have their default values of 0,0

This was verified by adding console.log() statements showing me the height and width.  If I placed an alert('hi') right after tempAvatar.src is set, then the alert's blocking gave the image loader time to catch up, and again the code worked correctly.

It is my opinion this code is buggy on Firefox, (only tested this on Firefox with FireBug to this point) and that there needs to be some sort of wait or delay after the tempAvatar.src has been set.

In the meantime, I suppose we can switch to HTML Resizing, but I wanted to make you aware of what the issue is.  If you wish to see the actual issue in action, let me know and I'll send you a URL that demonstrates the buggy behavior.

I am using FireFox 3.5.3, don't know what my users are using, but they have reported seeing the issue as well.

Thanks,

Steven
Moderator: hxxp:stangfix.com [nonactive]

Norv

Steven,
Thank you very much for the time taken to debug the issue! I've tracked the issue thanks to your comments for the developers to look into it:
http://dev.simplemachines.org/mantis/view.php?id=3842
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

AtlantaSteve

Good deal, thanks Norv!

I should add that it only seemed to happen with a user who had his image hosted on tripod.  Several use external hosting with photobucket and all is well with them, but the angelfire guy?  No good.  I suppose tripod is just slower?  Not sure.

Joshua Dickerson

What if after tempAvatar = new Image(); You did tempAvatar.width = smf_avatarMaxWidth; tempAvatar.height = smf_avatarMaxHeight; Then it will create an image that size and resize it later.
Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?


Advertisement: