Get the img path for the gravatar of the current user.

@param int $size

@return string
422258
public function buildAvatar($size = 150)
    {
        $gravatar = new Gravatar();
        $gravatar->setAvatarSize($size);
        $gravatar->enableSecureImages();

        return $gravatar->buildGravatarURL($this->getUserEmail());
    }
92440
public function getProfileImage($actor=null, $size=null)
    {

         /** @var CoreManager $coreManager */
        $coreManager =  $this->container->get('core_manager');
        $profileImage = $coreManager->getProfileImage($actor, $size);
        
        return  $profileImage;
    }
1265564
public static function format_size($size)
    {
        if ($size < 1024) {
            return $size . ' bytes';
        }
        if ($size < 1024*1024) {
            return round($size/1024) . ' KB';
        }
        if ($size < 1024*1024*10) {
            return round(($size/(1024*1024))*10)/10 . ' MB';
        }
        if ($size < 1024*1024*1024) {
            return round($size/(1024*1024)) . ' MB';
        }
        return round(($size/(1024*1024*1024))*10)/10 . ' GB';
    }
1276335
public function getImageSrc($type, $size)
	{
		if (empty($this->$type))
		{
			return null;
		}
		return $this->getImageConfig($type, $size, 'dir') . $this->$type;
	}
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;
    }
276660
public function getPortraitFile($size)
    {
        if (strpos($this->filename, '/')) {
            $filename = str_replace('/', '/avatars/'.$size, $this->filename);
        } else {
            $filename = $this->component.'/avatars/'.$size.$this->filename;
        }

        return $filename;
    }
505184
public function getPixelValue(string $size)
    {
        $value = preg_replace('/[^0-9.-]+/', '', $size);
        $unit = preg_replace('/[^acehimnprtvwx%]/', '', $size);

        // Convert 16px = 1em = 2ex = 12pt = 1pc = 1/6in = 2.54/6cm = 25.4/6mm = 100%
        switch ($unit) {
            case '':
            case 'px':
                return (int) round($value);

                break;

            case 'em':
                return (int) round($value * 16);

                break;

            case 'ex':
                return (int) round($value * 16 / 2);

                break;

            case 'pt':
                return (int) round($value * 16 / 12);

                break;

            case 'pc':
                return (int) round($value * 16);

                break;

            case 'in':
                return (int) round($value * 16 * 6);

                break;

            case 'cm':
                return (int) round($value * 16 / (2.54 / 6));

                break;

            case 'mm':
                return (int) round($value * 16 / (25.4 / 6));

                break;

            case '%':
                return (int) round($value * 16 / 100);

                break;
        }

        return 0;
    }
400413
public function generateImageUrl($file, $size=null)
	{
		$url = $this->config->get('prefix').'/'.$file;

		if (!is_null($size)) {
			$url .= '?size='.$size;
		}

		return URL::to($url);
	}
637368
public function img($srcImagePath, $size = null, $options = []) {
        return Html::img(self::imgSrc($srcImagePath, $size), $options);
    }
301651
public static function getSize( $size )
    {
        $dim = [];
        if( is_array( $size ) )
        {
            $dim[ 'w' ] = $size[0];
            $dim[ 'h' ] = isset( $size[1] ) ? $size[1] : $size[0];
        }
        else
        {
            $dim[ 'w' ] = $size;
            $dim[ 'h' ] = null;
        }

        return $dim;
    }
267711
public function thumbnail($size = 'full')
    {
        $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($this->id()), $size);
        return isset($thumb[0]) ? $thumb[0] : '';
    }
109564
public function read(int $size): string
    {
        $str = $this->channel->fread($size);
        if ($str === null) {
            $this->shutdownBrokenConnection('Cannot read from socket');
        } else {
            return $str;
        }
    }
1355831
public function getImagePath(Image $file, $sizeName = null)
	{
		if ( ! $file instanceof Image) {
			throw new Exception\RuntimeException('Image entity expected');
		}

		$path = $this->getFilesystemDir($file);
		$size = $file->findImageSize($sizeName);
				
		if ($size instanceof ImageSize) {
			$path .= self::RESERVED_DIR_SIZE 
					. DIRECTORY_SEPARATOR
					. $size->getFolderName() 
					. DIRECTORY_SEPARATOR;
		}

		$path .= $file->getRealFileName();

		return $path;
	}
1237221
public function getCoverURL($size = 'large')
    {
        $coverFilename = $this->_mixer->getCoverFile($size);

        $url = $this->getPathURL($coverFilename, true);

        return $url;
    }
946552
protected function getAvatar(Type $type, int $size)
    {
        if (!is_int($size) || $size < 1) {
            throw new \Exception('Illegal avatar size');
        }

        switch (true) {
            case ($type instanceof GroupType):
                $id = $type->id;
                $resource = 'group';
                break;
            case ($type instanceof AccountType):
                $id = $type->email;
                $resource = 'user';
                break;
            default:
                throw new \Exception('Unsupported type to retrieve avatar information for.');
        }

        $response = $this->client->get(
            $this->client->getConfig('base_uri') . '/avatars/' . $resource . '/' . $id . '/resized/' . $size . '/'
        );

        $json = json_decode($response->getBody());

        return (new AvatarType)->fromJson($json);
    }
884833
function getsize($size) {
        if ($size === null) return null;
        $last = strtolower($size{strlen($size)-1});
        $size = (int) $size;
        switch($last) {
            case 'g':
                $size *= 1024;
            case 'm':
                $size *= 1024;
            case 'k':
                $size *= 1024;
        }
        return $size;
    }
696460
protected function getByteSize($size)
    {
        if (! preg_match('/(\d+)\s*([tgkmbi]{1,3})/i', $size, $result)) {
            return $size;
        }

        $mapping = $this->mapping[strtolower($result[2])];
        return pow($mapping[0], $mapping[1]) * $result[1];
    }