Set (add) image size

@param ImageSize $size
@return boolean
543644
public function addImageSize(ImageSize $size)
	{
		if ($this->imageSizes->containsKey($size->getName())) {
			return false;
		} else {
			$this->imageSizes->set($size->getName(), $size);
			return true;
		}
	}
1067199
public function setWriteBuffer($size)
    {
        if (!is_resource($this->fp)) {
            return $this->raiseError('not connected');
        }

        $returned = stream_set_write_buffer($this->fp, $size);
        if ($returned === 0) {
            return true;
        }

        return $this->raiseError('Cannot set write buffer.');
    }
13352
public function setSize($size)
    {
        if (null === $size) {
            return $this;
        }

        $this->size = $size;
        $this->pixelRatio = (int) round($size / 5);

        return $this;
    }
625441
public function setPageSize($size)
    {
        $this->pageSize = ($size === null ? self::PAGE_SIZE : (int)$size);
        if ($this->pageSize < 0)
            $this->pageSize = self::PAGE_SIZE;

        return $this;
    }
1078249
function pixelate($size) {
		imagefilter($this->data,IMG_FILTER_PIXELATE,$size,TRUE);
		return $this->save();
	}
418079
public function bootstrapSize($size = null)
    {
        $styles = ['sm', 'xs', 'lg'];
        foreach ($styles as $style) {
            $this->removeClass('btn-' . $style);
        }

        return is_null($size) ? $this : $this->class('btn-' . $size);
    }
540314
public function setFileSize($size)
    {
        if ($size === null) {
            $this->fileSize = null;

            return $this;
        }

        if (!is_numeric($size)) {
            throw new InvalidArgumentException('File size must be an integer or a float.');
        }

        $this->fileSize = $size;

        return $this;
    }
1100342
public function multiply(Size $size): Size
    {
        $this->bit = $this->bit * $size->get('b');
        return $this;
    }
594526
public function setSize( $size ){
		if( !is_integer( $size ) )
			throw new InvalidArgumentException( 'Size must be an integer' );
		if( $size < 1 )
			throw new OutOfBoundsException( 'Size must be atleast 1 pixel' );
		if( $size > 512 )
			throw new OutOfBoundsException( 'Size must be atmost 512 pixels' );
		$this->size	= $size;
	}
788632
public function ensureCapacity(int $size) : void
    {
        if ($size > count($this->bits) << 5) {
            $this->bits->setSize(($size + 31) >> 5);
        }
    }
1095636
public function setCacheSize($size)
    {
        $this->cacheSize = $size;
        $this->logger->debug('LRUcache: set size: ' . $size );
        return true;
    }
635142
public function setPagination($offset, $size)
    {
        if (is_int($offset)) {
            $this->query->setFrom($offset);
        }

        if (is_int($size)) {
            $this->query->setSize($size);
        }

        return $this;
    }
1083932
public function size($file, int $size): bool
    {
        if (empty($filename = $this->resolveFilename($file))) {
            return false;
        }

        return $this->files->size($filename) <= ($size * 1024);
    }
275320
public static function resize($image, $size)
    {
        if (!$image) {
            return false;
        }

        list($width, $height) = self::parseSize($size);

        if ($height == 'auto' && $width == 'auto') {
            return false;
        }

        $o_wd = imagesx($image);
        $o_ht = imagesy($image);

        $x = $y = 0;
        if ($height == 'auto') {
            $height = round(($width / $o_wd) * $o_ht);
        } elseif ($width == 'auto') {
            $width = round(($height / $o_ht) * $o_wd);
        } elseif ($width && !$height) {
            //make square image
            $height = $width;
            if ($o_wd > $o_ht) {
                $x = ceil(($width - $height) / 2);
                $o_wd = $o_ht;
            } elseif ($o_ht > $o_wd) {
                $y = ceil(($height - $width) / 2);
                $o_ht = $o_wd;
            }
        } else {
            $w = round($o_wd * $height / $o_ht);
            $h = round($o_ht * $width / $o_wd);

            if (($height - $h) < ($width - $w)) {
                $width = &$w;
            } else {
                $height = &$h;
            }
        }

        $tmp = imageCreateTrueColor($width, $height);
        imagesavealpha($tmp, true);
        $color = imagecolorallocatealpha($tmp, 0x00, 0x00, 0x00, 127);
        imagefill($tmp, 0, 0, $color);
        imagecopyresampled($tmp, $image, 0, 0, $x, $y, $width, $height, $o_wd, $o_ht);

        return $tmp;
    }
969356
private function setImageSize($image, $size, $needExactSize = false)
    {
        if (empty($size)) {
            return $image;
        }

        if ($needExactSize || $image->getImageWidth() > $size[0]) {
            if ($size[0] == 0 || $size[1] == 0) {
                $image->scaleImage($size[0], $size[1]);
            } else {
                $image->cropThumbnailImage($size[0], $size[1]);
            }
        }

        return $image;
    }
1302524
public function setBlockSize($size)
    {
        if ($size <= 1) {
            throw new \InvalidArgumentException("Pixel Size Must Be Greater Than One");
        }
        $this->size = (int) abs($size);

        return $this;
    }
609885
public function setSize($size = 32)
    {
        $size = (int)$size;

        // Gravatars can be sized 1px up to 2048px square: https://en.gravatar.com/site/implement/images/#size
        if ($size < 1) {
            $size = 1;
        }

        if ($size > 2048) {
            $size = 2048;
        }

        $this->size = $size;

        return $this;
    }