<commit_before><?php
namespace Concrete\Core\Application\Service;

use Concrete\Core\File\StorageLocation\StorageLocation;
use Loader;
use Config;
use \Concrete\Core\Authentication\AuthenticationType;

class Avatar
{

    /**
     * @param \UserInfo $uo
     * @param bool $suppressNone
     * @param float $aspectRatio
     * @return string
     */
    public function outputUserAvatar($uo, $suppressNone = false, $aspectRatio = 1.0)
    {
        if (is_object($uo)) {
            $ati = $this->getAuthTypeImagePath($uo);
            $width = Config::get('concrete.icons.user_avatar.width') * $aspectRatio;
            $height = Config::get('concrete.icons.user_avatar.height') * $aspectRatio;

            if ($uo->hasAvatar()) {
                $src = $this->getImagePath($uo);
                $str = '<img class="u-avatar" src="' . $src . '" width="' . $width . '" height="' . $height . '" '
                    . 'alt="' . $uo->getUserName() . '" />';

                return $str;
            } elseif (Config::get('concrete.user.gravatar.enabled')) {
                return $this->get_gravatar(
                    $uo->getUserEmail(),
                    Config::get('concrete.icons.user_avatar.width'),<commit_msg>Fix scaling of avatars fetched from Gravatar<commit_after><?php
namespace Concrete\Core\Application\Service;

use Concrete\Core\File\StorageLocation\StorageLocation;
use Loader;
use Config;
use \Concrete\Core\Authentication\AuthenticationType;

class Avatar
{

    /**
     * @param \UserInfo $uo
     * @param bool $suppressNone
     * @param float $aspectRatio
     * @return string
     */
    public function outputUserAvatar($uo, $suppressNone = false, $aspectRatio = 1.0)
    {
        if (is_object($uo)) {
            $ati = $this->getAuthTypeImagePath($uo);
            $width = Config::get('concrete.icons.user_avatar.width') * $aspectRatio;
            $height = Config::get('concrete.icons.user_avatar.height') * $aspectRatio;

            if ($uo->hasAvatar()) {
                $src = $this->getImagePath($uo);
                $str = '<img class="u-avatar" src="' . $src . '" width="' . $width . '" height="' . $height . '" '
                    . 'alt="' . $uo->getUserName() . '" />';

                return $str;
            } elseif (Config::get('concrete.user.gravatar.enabled')) {
                return $this->get_gravatar(
                    $uo->getUserEmail(),
                    Config::get('concrete.icons.user_avatar.width') * $aspectRatio,
{'fraction_non_alphanumeric': 0.15797914995990378, 'fraction_numerical': 0.0016038492381716118, 'mean_word_length': 2.269986893840105, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5993415', 'n_tokens_mistral': 770, 'n_tokens_neox': 742, 'n_words': 134}