MyBB Community Forums

Full Version: [F] Avatar not resized
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
if($post['avatar'] != "" && ($mybb->user['showavatars'] != 0 || !$mybb->user['uid']))
		{
			$post['avatar'] = htmlspecialchars_uni($post['avatar']);
			$avatar_dimensions = explode("|", $post['avatardimensions']);
			
			if($avatar_dimensions[0] && $avatar_dimensions[1])
			{
				list($max_width, $max_height) = explode("x", $mybb->settings['postmaxavatarsize']);
			 	if($avatar_dimensions[0] > $max_width || $avatar_dimensions[1] > $max_height)
				{
					require_once MYBB_ROOT."inc/functions_image.php";
					$scaled_dimensions = scale_image($avatar_dimensions[0], $avatar_dimensions[1], $max_width, $max_height);
					$avatar_width_height = "width=\"{$scaled_dimensions['width']}\" height=\"{$scaled_dimensions['height']}\"";
				}
				else
				{
					$avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\"";	
				}
			}
			
			eval("\$post['useravatar'] = \"".$templates->get("postbit_avatar")."\";");
			$post['avatar_padding'] = "padding-right: 10px;";
		}
		else
		{
			$post['useravatar'] = "";
		}

Its not passing the if($avatar_dimensions[0] && $avatar_dimensions[1]) statement which means he has an old avatar from way back in the day when we didn't store dimensions on avatars.
Could we force the upgrader to give avatars with no dimensions, the default max dimensions so that doesn't happen? I've seen it twice now on here.
Yeh, that's what I've done
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.
Is this Bug fixed in MyBB 1.4 Beta 2 ?

Because some Avatars ( the first and the third) in the following image still not resize...

[attachment=9788]

[attachment=9789]