Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
2.1k views
in Q2A Core by
edited by

q2a v1.51 can't display avatar  in IE(7.0,8.0,9.0),the avatar become very samll,and looks like an dot. use firebug check ,find the height and width all have no number.

but v1.5 work fine. the height=46 ,and the width=49.

maybe this is a bug of 1.51?

V1.5

 

V1.51

Q2A version: 1.51
by
moved by
Is anybody have solution to this problem ?

2 Answers

0 votes
by

See the "Avatar size on questions lists" setting in the 'Users' section of the admin panel.

by
I also think that it is a bug in 1.5.1 , i am also facing this problem.
by
@Aslan  the "Avatar size on questions lists"  set  is right.
by
I second the question. Width and height in ver 1.51. are set to no value and the avatar wont show in IE. I didn't have this issue with ver 1.5.0
0 votes
by

Sorry about this - it was a bug introduced in Q2A 1.5.1, which meant that the width and height were not detected properly when uploading avatars. It didn't affect avatars that were uploaded to the database using a previous version.

The fix for the uploading issue is to change the following code in function qa_image_constrain_data(...) in qa-util-image.php:

 

$inwidth=imagesx($inimage);
$inheight=imagesy($inimage);
 
$outwidth=$inwidth;
$outheight=$inheight;
 
// always call qa_gd_image_resize(), even if the size is the same, to take care of possible PNG transparency
qa_image_constrain($outwidth, $outheight, $size);
qa_gd_image_resize($inimage, $outwidth, $outheight);
 
... to ...
 
$width=imagesx($inimage);
$height=imagesy($inimage);
 
// always call qa_gd_image_resize(), even if the size is the same, to take care of possible PNG transparency
qa_image_constrain($width, $height, $size);
qa_gd_image_resize($inimage, $width, $height);
 
But there is also the issue of displaying existing avatars which were uploaded with this problem, and which lack width/height information. The solution is to  replace the following code in function qa_get_avatar_blob_html(...) in qa-app-format.php:
 
$html='<IMG SRC="'.qa_path('image', array('qa_blobid' => $blobid, 'qa_size' => $size), null, QA_URL_FORMAT_PARAMS).
'" WIDTH="'.$width.'" HEIGHT="'.$height.'" CLASS="qa-avatar-image"/>';
 
... with ...
 
$html='<IMG SRC="'.qa_path('image', array('qa_blobid' => $blobid, 'qa_size' => $size), null, QA_URL_FORMAT_PARAMS).
'"'.(($width && $height) ? (' WIDTH="'.$width.'" HEIGHT="'.$height.'"') : '').' CLASS="qa-avatar-image"/>';
 
Again, sorry about this. I will roll the fix out as Q2A 1.5.2 shortly, as soon as some people confirm that this solves the problem.

 

by
thank you very much~~~
have resolved this question.
...