Get Gravatar image tag.

@param  string       $email
@param  string|null  $alt
@param  array        $attributes
@param  string|null  $rating

@return \Arcanedev\Html\Elements\Img
194376
public function image($email, $alt = null, array $attributes = [], $rating = null)
    {
        $dimensions = array_values(
            Arr::only($attributes, ['width', 'height'])
        );

        $size = count($dimensions)
            ? min(512, max($dimensions))
            : $this->getSize();

        return Img::make()
                  ->src($this->src($email, $size, $rating))
                  ->attributeUnless(is_null($alt), 'alt', $alt)
                  ->attributes($attributes);
    }
953401
def gravatar_url(email, size=32):
    
    bits = (md5(email.lower().encode("utf-8")).hexdigest(), size)
    return "//www.gravatar.com/avatar/%s?s=%s&d=identicon&r=PG" % bits
492483
public function gravatar($size = 60, $default = 'mm', $rating = 'g')
    {
        $email = $this->email;

        return 'http://www.gravatar.com/avatar/'.md5(strtolower(trim($email)))."?s={$size}&d={$default}&r={$rating}";
    }
344748
def get_gravatar(email, size=80, rating='g', default=None,
                 protocol=PROTOCOL):
    
    gravatar_protocols = {'http': 'http://www',
                          'https': 'https://secure'}
    url = '%s.gravatar.com/avatar/%s' % (
        gravatar_protocols[protocol],
        md5(email.strip().lower().encode('utf-8')).hexdigest())
    options = {'s': size, 'r': rating}
    if default:
        options['d'] = default

    url = '%s?%s' % (url, urlencode(options))
    return url.replace('&', '&amp;')
159729
public static function Email($Email) {
      $Max = max(3, floor(strlen($Email) / 2));
      $Chunks = str_split($Email, mt_rand(3, $Max));
      $Chunks = array_map('htmlentities', $Chunks);
      
      $St = mt_rand(0,1);
      $End = count($Chunks) - mt_rand(1, 4);
      
      $Result = '';
      foreach ($Chunks as $i => $Chunk) {
         if ($i >= $St && $i <= $End) {
            $Result .= '<span style="display:inline;display:none">'.str_rot13($Chunk).'</span>';
         }
         
         $Result .= '<span style="display:none;display:inline">'.$Chunk.'</span>';
      }
      
      return '<span class="Email">'.$Result.'</span>';
   }
789142
public function tag($tag, $content, array $attributes = [])
    {
        return $this->htmlBuilder->tag($tag, $content, $attributes);
    }
777854
public function avatar($email) {
		if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
			$baseUrl = $this->useHttps ? $this->https($this->baseUrl) : $this->baseUrl;
			$url = $baseUrl . "avatar/" . $this->generateHash($email);
		} else {
			throw new InvalidArgumentException("The avatar filter must be passed a valid Email address");
		}

		if ($this->rating) {
			$url = $this->rating($url, $this->rating);
		}

		if ($this->size) {
			$url = $this->size($url, $this->size);
		}

		if ($this->default) {
			$url = $this->def($url, $this->default);
		}

		return $url;
	}
1134908
public function getHtml(array $attributes = []): string
    {
        return self::buildTag('option', $this->getLabel(),
            array_merge(
                [
                    'value'    => $this->getValue(),
                    'selected' => $this->isSelected,
                ],
                $attributes)
        );
    }
963421
public function generateUrl($type, $email, array $attr = [])
    {
        if (!empty($email)) {
            $this->setEmail($email);
        }

        if (isset($attr['size'])) {
            $this->setSize($attr['size']);
        }

        if (isset($attr['imgset'])) {
            $this->setImageSet($attr['imgset']);
        }

        if (isset($attr['rating'])) {
            $this->setRating($attr['rating']);
        }

        $uri = '?';
        $ignore = ['email', 'hash', 'secure'];
        foreach ($this->_options as $k => $v) {
            if (!in_array($k, $ignore)) {
                $uri .= $k.'='.$v.'&';
            }
        }
        $uri = rtrim($uri, '&');

        $base = (($this->_options['secure']) ? self::BASE_HTTPS : self::BASE_HTTP);

        switch (strtolower($type)) {
        case 'avatar':
            $url = $base.'avatar/';
            break;
        case 'profile':
            $url = $base;
            break;
        default:
            throw new \Exception('Invalid URL type given! Must be avatar or profile!');
        }

        return $url.$this->getHash();
    }
213270
public static function getReforgedRunePathIconO( StaticReforgedRunePathDto $runePath, array $attributes = [] ): Html
	{
		$attrs = array_merge([ 'alt'   => $runePath->name ], self::getSetting(self::SET_CUSTOM_IMG_ATTRS, []), $attributes);
		$attrs['class'] = implode(' ', [
			self::getSetting(self::SET_DEFAULT_CLASS),
			self::getSetting(self::SET_REFORGED_RUNE_ICON_CLASS),
			@self::getSetting(self::SET_CUSTOM_IMG_ATTRS, [])['class'],
			@$attributes['class'],
		]);
		$attrs['src'] = self::getReforgedRunePathIconUrlO($runePath);

		return Html::el('img', $attrs);
	}
434583
public function getGravatar($email = null)
    {
        if (isset($email)) {
            $this->setEmail((string)$email);
        }

        $url = self::BASE_URL;
        if ($this->secure) {
            $url = self::BASE_URL_SECURE;
        }

        $url .= $this->email;
        $url .= $this->extension;
        $url .= '?s=' . $this->size;
        $url .= '&d=' . $this->default;

        if ($this->forceDefault) {
            $url .= '&forcedefault=y';
        }

        $url .= '&rating=' . $this->rating;

        return $url;
    }
721832
public static function mailto($email, $title = null, $attributes = array())
    {
        $html = self::getInstance()->html;
        $args = func_get_args();
        return call_user_func_array(array($html, __FUNCTION__), $args);
    }
1163408
public function getHtml(array $attributes = []): string
    {
        $optionsHtml = '';
        foreach ($this->options as $option) {
            $optionsHtml .= $option->getHtml();
        }

        return self::buildTag('select', $optionsHtml,
            array_merge(
                [
                    'name'     => $this->getName(),
                    'required' => $this->isRequired() && $this->hasEmptyOption,
                ],
                $attributes
            ), true
        );
    }
33333
public static function profile($email)
    {
        $url = sprintf('%s/%s.json', self::$gravatarURL, md5($email));
        
        $client = new Client();
        
        return json_decode($client->get($url)->getBody()->getContents());
    }
748340
public static function get_gravatar($email, $size = 32)
    {
        if (self::is_https()) {
            $url = 'https://secure.gravatar.com/';
        } else {
            $url = 'http://www.gravatar.com/';
        }

        $url .= 'avatar/' . md5($email) . '?s=' . (int) abs($size);

        return $url;
    }
1096798
public function image($url, $alt = null, $options = [])
    {
        $options['alt'] = $alt;

        return '<img src="'.$this->_generator->asset($url).'"'.self::attributes($options).'>';
    }
970138
public function img($src, $alt = '', $class = '', $attributes = [])
    {
        return sprintf('<img src="%s" alt="%s" class="%s" %s>',
            $this->url($src),
            $alt,
            $class,
            $this->HtmlAttributes($attributes)
        );
    }