Returns image path on the file-system filtered by provided size

@param string $size
@throws RuntimeException when not ready to be used
@return string
335745
public function getPath($size)
    {
        if ($this->isProvided()) {
            return $this->locationBuilder->buildPath($this->id, $this->cover, $size);
        } else {
            throw new RuntimeException('You gotta provide both id and cover to use this method');
        }
    }
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;
	}
1369614
public function getImageSrc($size = null)
    {
        $owner = $this->owner;

        $prefix = '';
        if (Yii::$app->request instanceof \yii\web\Request) {
            $prefix = Yii::$app->request->baseUrl;
            $host = Yii::$app->request->hostInfo;
            // If current application is backend - return absolute frontend image path
            if (!empty($this->_backendSubdomain) && strpos($host, $this->_backendSubdomain) !== false) {
                $prefix = str_replace($this->_backendSubdomain, '', $host) . $prefix;
            }
            if (!empty($this->_backendRoute) && strpos($prefix, $this->_backendRoute) !== false) {
                $prefix = str_replace($this->_backendRoute, '', $prefix);
            }
        }

        $image = $owner->{$this->_imageAttribute};
        if (empty($image)) {
            if (isset($this->getImageSizes()[$size])) {
                return $prefix . '/images/' . static::addPrefixToFile($this->_noImageBaseName, $size);
            }

            return $prefix . '/images/' . $this->_noImageBaseName;
        }

        $root = Yii::getAlias($this->_rootPathAlias); // Webroot
        $path = Yii::getAlias($this->_savePathAlias); // Uploading dir
        $path = str_replace($root, '', $path); // Remove server path
        $path = str_replace('\\', '/', $path); // Replace "\" to "/"
        $folder = $prefix . '/' . trim($path, '/') . '/';

        if (!empty($size)) {
            return $folder . static::addPrefixToFile($image, $size);
        } else {
            return $folder . $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;
    }
817969
public function get_url( $size ) {
		$url = null;
		if ( isset( $this->struct['return_type'] ) && 'url' === $this->struct['return_type'] ) {
			$url = $this->get_value();
		} else {
			$data = wp_get_attachment_image_src( $this->get_value(), $size );
			if ( ! empty( $data ) ) {
				$url = $data[0];
			}
		}

		return $url;
	}
1061353
public function render(Size $size)
    {
        $formatter = $this->getFormatter();
        $arguments = [
            $size->getWidth(),
            $size->getHeight(),
        ];

        if ($size->hasUnits()) {
            $arguments[] = $formatter->renderEscape($size->getWidthUnit());
            $arguments[] = $formatter->renderEscape($size->getHeightUnit());
        }

        return $formatter->renderObjectAssignment($size, $formatter->renderObject('Size', $arguments));
    }
1207633
public function getListSizeMarker($size)
    {
        $b = '';

        if ($size < Constants::SIZE_TINY) {
            $b .= chr(Constants::LIST_TINY + $size);

            return $b;
        }

        if ($size < Constants::SIZE_8) {
            $b .= chr(Constants::LIST_8);
            $b .= $this->packUnsignedShortShort($size);

            return $b;
        }

        if ($b < Constants::SIZE_16) {
            $b .= chr(Constants::LIST_16);
            $b .= $this->packUnsignedShort($size);

            return $b;
        }

        if ($b < Constants::SIZE_32) {
            $b .= chr(Constants::LIST_32);
            $b .= $this->packUnsignedLong($size);

            return $b;
        }

        throw new SerializationException(sprintf('Unable to create marker for List size %d', $size));
    }
398111
public function image_url($size = 'full') {
        if (!isset($this->file_count_i)) {
            return null;
        }

        if ($this->file_count_i == 1) {
            return "http://collections.kent.ac.uk/api/image.php?request=" . $this->files_t . '/' . $size;
        }

        $files = explode(',', $this->files_t);

        $result = array();
        foreach ($files as $file) {
            $result[] = "http://collections.kent.ac.uk/api/image.php?request=" . $file . '/' . $size;
        }

        return $result;
    }
810942
public function getUrl($size)
    {
        if ($this->isProvided()) {
            return $this->locationBuilder->buildUrl($this->id, $this->cover, $size);
        } else {
            throw new RuntimeException('You gotta provide both id and cover to use this method');
        }
    }
845529
public function getPortraitFile($size)
    {
        $filename = $this->filename;

        //get file extension
        $extension = explode('.', $filename);
        $extension = array_pop($extension);

        //remove extension
        $name = preg_replace('#\.[^.]*$#', '', $filename);

        $filename = $name.'_'.$size.'.'.$extension;

        return $filename;
    }
1091307
public function get_raw($size = null) {
    return Podio::get($this->get_download_link($size), array(), array('file_download' => true))->body;
  }
1013021
public static function get_image_width($size)
    {
        // Get the size meta array.
        $size = static::get_image_size($size);

        if ($size === false) {
            return false;
        }

        if (isset($size['width'])) {
            return (int) $size['width'];
        }

        return false;
    }
89343
public function thumbnail($size = null)
    {
        $size = ($size) ? $size : $this->config->get('images.size');

        if ($id = $this->thumbnailId) {
            return new Image($id, $size);
        }
    }
240587
public function generate($size)
    {
        if ($size == 0) {
            return static::emptyValue($size);
        }
        $file = fopen(static::$file, 'rb');
        if (!$file) {
            return static::emptyValue($size);
        }
        if (function_exists('stream_set_read_buffer')) {
            stream_set_read_buffer($file, 0);
        }
        $result = fread($file, $size);
        fclose($file);

        return $result;
    }
1025250
public function median(int $size): Image
    {
        return $this->rank($size, $size, ($size * $size) / 2);
    }
69697
public static function fileSize($size)
    {
        $units = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'];

        for ($i = 0; $size > 1024; $i++) {
            $size /= 1024;
        }

        return __('Size unit ' . $units[$i], round($size, 2));
    }
1024342
protected function find_image_size_from_width( $sizes, $width ) {
		foreach ( $sizes as $name => $size ) {
			if ( $width === $size['width'] ) {
				return $name;
			}
		}
		return null;
	}