get icon image
@param int $size image size
@return resource GD image
331809
public function getImage($size = null)
    {
        assert('$this->image');
        if ($size === null) {
            $size = $this->maxSize;
        }
        $icon = imagecreatetruecolor($size, $size);
        $srcSize = $this->tileSize * $this->tiles;
        imagecopyresampled($icon, $this->image, 0, 0, 0, 0, $size, $size, $srcSize, $srcSize);
        return $icon;
    }
1025250
public function median(int $size): Image
    {
        return $this->rank($size, $size, ($size * $size) / 2);
    }
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');
    }
65666
public function sizeUrl($size)
    {
        if (($this->base['return_format'] === 'array') && isset($this->base['value']['sizes'][$size])) {
            return $this->base['value']['sizes'][$size];
        } elseif ($this->base['return_format'] === 'id') {
            if ($src = wp_get_attachment_image_src($this->id(), $size)) {
                return $src[0];
            }
        }

        return '';
    }
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 '';
            }
        }
    }
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;
    }
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);
    }
639513
public function get_sizes( $size = '' ) {
		global $_wp_additional_image_sizes;
		$sizes = array();
		$get_intermediate_image_sizes = get_intermediate_image_sizes();

		// Create the full array with sizes and crop info.
		foreach ( $get_intermediate_image_sizes as $_size ) {
			if ( in_array( $_size, array( 'thumbnail', 'medium', 'large' ) ) ) {
				$sizes[ $_size ]['width'] = get_option( $_size . '_size_w' );
				$sizes[ $_size ]['height'] = get_option( $_size . '_size_h' );
				$sizes[ $_size ]['crop'] = (bool) get_option( $_size . '_crop' );
			} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
				$sizes[ $_size ] = array(
					'width'		=> $_wp_additional_image_sizes[ $_size ]['width'],
					'height'	=> $_wp_additional_image_sizes[ $_size ]['height'],
					'crop'		=> $_wp_additional_image_sizes[ $_size ]['crop'],
				);
			}
		}

		// If $size argument is supplied, just return that size.
		if ( $size ) {
			if ( isset( $sizes[ $size ] ) ) {
				return $sizes[ $size ];
			} else {
				return false;
			}
		}

		return $sizes;
	}
32470
public function getUrlImage($size = "", $name = "")
    {
        if (!empty($size)) {
            $size.="/";
        }
        return $this->getUrlRacine()."images/".$size.$name;
    }
422258
public function buildAvatar($size = 150)
    {
        $gravatar = new Gravatar();
        $gravatar->setAvatarSize($size);
        $gravatar->enableSecureImages();

        return $gravatar->buildGravatarURL($this->getUserEmail());
    }
785982
public String getIconUrl(String size) {
        if (iconUrl == null) {
            return Jenkins.RESOURCE_PATH + "/images/" + size + "/" + HEALTH_UNKNOWN_IMG;
        }
        if (iconUrl.startsWith("/")) {
            return iconUrl.replace("/32x32/", "/" + size + "/");
        }
        return Jenkins.RESOURCE_PATH + "/images/" + size + "/" + iconUrl;
    }
47058
private function _getImageToSize(array $images, int $size)
	{
		$selectedImage = null;
		$selectedSize = 0;

		foreach ($images as $image)
		{
			if (is_array($image))
			{
				$imageWidth = isset($image['width']) && is_numeric($image['width']) ? $image['width'] : 0;
				$imageHeight = isset($image['height']) && is_numeric($image['height']) ? $image['height'] : 0;
				$imageSize = max($imageWidth, $imageHeight);

				if (!$selectedImage ||
					($selectedSize < $size && $imageSize > $selectedSize) ||
					($selectedSize > $imageSize && $imageSize > $size))
				{
					$selectedImage = $image;
					$selectedSize = $imageSize;
				}
			}
		}

		return $selectedImage;
	}
223093
public function iconPath($image, $size = 16)
    {
        if (!$image) {
            return '';
        }

        $parts = explode(';', $image);
        $fileId = $parts[0];

        $src = $this->router->generate('frontendmedia_icon', ['fileId' => $fileId, 'size' => $size], UrlGeneratorInterface::ABSOLUTE_PATH);

        return $src;
    }
115688
public function getBoxSize(array $imageSize, array $size)
    {
        list($width, $height) = $size;

        if ((null == $width) && (null == $height)) {
            return $imageSize;
        }

        list($imageWidth, $imageHeight) = $imageSize;

        if ((null !== $width) && (null == $height)) {
            $height = ceil($width * ($imageHeight / $imageWidth));

            if ($height > $imageHeight) {
                $height = $imageHeight;
            }

            return array($width, $height);
        }

        if ((null === $width) && (null != $height)) {
            $width = ceil($height * ($imageWidth / $imageHeight));

            if ($width > $imageWidth) {
                $width = $imageWidth;
            }

            return array($width, $height);
        }

        return $size;
    }
389247
public function thumbUrl( string $size = 'thumbnail') {
		$size = WP::getImageSize( $size );
		
		return get_avatar_url( $this->ID, ['size' => $size['width'] ] );
	}
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;
	}
828752
public function getAvatarTag($size = 96, $alt = null)
    {
        return get_avatar($this->getId(), $size, null, $alt ?: $this->getDisplayName());
    }