Return an avatar URL of an actor. If actor doesn't have an avatar, then it reurns the
default avatar.

@param ComActorsDomainEntityActor $actor
@param string                     $size

@return string
336690
public function getAvatarURL($actor, $size = 'square')
    {
        if ($actor->hasPortrait()) {
            return $actor->getPortraitURL($size);
        }

        return $this->getService('com:base.template.asset')
                    ->getURL('lib_anahita/images/avatar/'.$size.'_default.gif');
    }
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;
    }
1301721
protected function getAvatarUrl( $id, $size ) {
		$attachments_fallback_chain = $this->getAttachmentFallbackChain( $id );

		foreach ( $attachments_fallback_chain as $attachment_id ) {
			$image = wp_get_attachment_image_src( $attachment_id, $size );
			if ( ! empty( $image ) ) {
				return $image[0];
			}
		}

		return null;
	}
1054449
public static function getAvatar(User $user, $size = self::AVATAR_MIDDLE)
    {
        $size = in_array($size, [self::AVATAR_BIG, self::AVATAR_MIDDLE, self::AVATAR_SMALL]) ? $size : self::AVATAR_BIG;
        if ($user->getIsAvatar()) {
            $avatarPath = AvatarHelper::getAvatarPath($user->id) . "_avatar_{$size}.jpg";
            return static::getDisk()->url($avatarPath) . '?_t=' . $user->updated_at;
        } else {
            $avatarUrl = "/img/no_avatar_{$size}.gif";
            if (Yii::getAlias('@webroot', false)) {
                $baseUrl = UserAsset::register(Yii::$app->view)->baseUrl;
                return Url::to($baseUrl . $avatarUrl, true);
            }
        }
        return '';
    }
40720
public function thumbnailURL($size = 'large')
    {
        if (!in_array($size, ['large', 'medium', 'small'])) {
            return false;
        }

        $info = $this->parseLink();
        $service = $this->getService();

        if (!$info || !$service) {
            return false;
        }

        if ($service == 'YouTube') {
            if ($size == 'large') {
                $img = 'hqdefault.jpg';
            } elseif ($size == 'medium') {
                $img = 'mqdefault.jpg';
            } else {
                $img = 'default.jpg';
            }
            return 'https://i.ytimg.com/vi/' . $this->VideoID . '/' . $img;
        }

        if ($service == 'Vimeo') {
            $data = $this->getCachedJsonResponse(
                'https://vimeo.com/api/v2/video/' . $this->VideoID . '.json'
            );

            if (!$data) {
                return false;
            }

            if ($size == 'large' && (!empty($data[0]['thumbnail_large']))) {
                return $data[0]['thumbnail_large'];
            } elseif ($size == 'medium' && (!empty($data[0]['thumbnail_medium']))) {
                return $data[0]['thumbnail_medium'];
            } elseif (!empty($data[0]['thumbnail_small'])) {
                return $data[0]['thumbnail_small'];
            }
        }

        return false;
    }
722136
public function searchActor($actor)
    {
        if (empty($actor)) return false;
        foreach ($this->actorMap as $node_name => $set) {
            if ($set->contains($actor)) {
                return $node_name;
            }
        }
        return false;
    }
919195
public function getAvatar($size = self::AVATAR_SIZE_DEFAULT)
    {
        $avatar = $this->getImage(self::KEY_AVATAR, $size, $size);
        if (empty($avatar)) {
            return static::getUrlAvatar($size);
        }
        return $avatar;
    }
737264
public function getPortraitURL($size = 'square')
    {
        $filename = $this->_mixer->getPortraitFile($size);
        $url = $this->getPathURL($filename, true);

        return $url;
    }
1073997
public function getThumbUrl($size = 'thumb')
    {
        $url = $this->package->config('icons.url');
        $icons = $this->package->config('icons.files');

        if (!$this->metadata->isFile()) {
            return $url . $icons['dir'];
        }

        if ($this->isImage()) {
            $thumbs = $this->getThumbsDetails();

            if (!array_key_exists($size, $thumbs)) {
                return $url . $icons['img'];
            }

            return $thumbs[$size]['url'];
        }

        $mime = $this->getMime();
        if (!array_key_exists($mime, $icons)) {
            $message = sprintf('Configuration file is missing for `%s` file type in `icons.files` array', $mime);
            throw new \Exception($message);
        }

        return $url . $icons[$mime];
    }
719712
protected function validateSize($size)
    {
        if (! is_int($size) && ! ctype_digit($size)) {
            throw new \InvalidArgumentException('Avatar size specified must be an integer');
        }

        if ($size < 0 || $size > 2048) {
            throw new \InvalidArgumentException('Avatar size must be within 0 pixels and 2048 pixels');
        }
    }
1124171
public function source(Size $size): string
    {
        return $this->maker()->make($this->name, $this->options($size));
    }
847538
public function getAvatar($uid, $size = 'big', $type = 'virtual')
    {
        $size = in_array(strtolower($size), ['big', 'middle', 'small']) ? strtolower($size) : 'big';
        $type = in_array(strtolower($type), ['real', 'virtual']) ? strtolower($type) : 'virtual';
        return $this->config['api'] . sprintf("/avatar.php?uid=%d&type=%ss&size=%s", $uid, $type, $size);
    }
1073891
public static function getImageFromArray($data, $size, $dimensions = false)
    {
        if($dimensions === true)
        {
            $image = (object) [
                'url' => $data['sizes'][$size],
                'width' => $data['sizes'][$size . '-width'],
                'height' => $data['sizes'][$size . '-height']
            ];
        }
        else
        {
            $image = $data['sizes'][$size];
        }
        return $image;
    }
727073
public function urlify($size, $multiplier = 1)
    {
        // Get fluent config
        $config = $this->getConfig();

        // Setup vars
        $size = $this->sizes[$size];
        $scale = $size[0] / $this->bench;
        $width = $height = null;

        // Figure out percentage sizes.  First one of the dimensnios is tested
        // to see if it looks a percentage.  If so, make it a percentage of one of
        // the hard coded sizes.  Otherwise, scale the dimension by comaring the
        // size to a the benchmark (laptop).
        if ($perc = $this->perc($config['width'])) {
            $width = $perc * $size[0] * $multiplier;
        } elseif ($config['width']) {
            $width = $config['width'] * $scale * $multiplier;
        }
        if ($perc = $this->perc($config['height'])) {
            $height = $perc * $size[1] * $multiplier;
        } elseif ($config['height']) {
            $height = $config['height'] * $scale * $multiplier;
        }

        // Produce the Croppa URL
        $path = Croppa::url($this->getAttributeValue('file'),
            $width,
            $height,
            $config['options']
        );
        if ($path) {
            return asset($path);
        }
    }
395207
public function getAvatar($size = self::AVATAR_MIDDLE)
    {
        $size = in_array($size, ['big', 'middle', 'small']) ? $size : 'big';
        if ($this->getIsAvatar()) {
            $avatarFileName = "_avatar_$size.jpg";
            return $this->getAvatarUrl($this->id) . $avatarFileName;
        } else {
            switch ($size) {
                case 'big':
                    $avatarUrl = '/img/no_avatar_big.gif';
                    break;
                case 'middle':
                    $avatarUrl = '/img/no_avatar_middle.gif';
                    break;
                case 'small':
                    $avatarUrl = '/img/no_avatar_small.gif';
                    break;
                default:
                    $avatarUrl = '/img/no_avatar_big.gif';
            }
            if (Yii::getAlias('@webroot', false)) {
                $baseUrl = UserAsset::register(Yii::$app->view)->baseUrl;
                return Url::to($baseUrl . $avatarUrl, true);
            } else {
                return '';
            }
        }
    }
704829
def avatar(self, blogname, size=64):
        
        url = "/v2/blog/{}/avatar/{}".format(blogname, size)
        return self.send_api_request("get", url)
242335
public function getImage($type, $size, array $attributes = array())
	{
		if (empty($this->$type))
		{
			return null;
		}
		$html = '<img src="' . $this->getImageSrc($type, $size) . '"';
		$html .= ' alt="' . $this->{$type.'_alt'} . '"';
		$html .= ' width="' . $this->getImageWidth($type, $size) . '"';
		$html .= ' height="' . $this->getImageHeight($type, $size) . '"';
		
		$html_attributes = '';
		if (!empty($attributes)) {
			$html_attributes = join(' ', array_map(function($key) use ($attributes) {
				if(is_bool($attributes[$key]))
				{
					return $attributes[$key] ? $key : '';
				}
				return "{$key}=\"{$attributes[$key]}\"";
			}, array_keys($attributes)));
		}
		
		return $html;
	}