19 declare(strict_types=1);
    76         $clone->dimension_mode = self::DIMENSION_MODE_FIT;
    77         $clone->width = $clone->height = $max_size;
   106         $clone = clone $this;
   107         $clone->dimension_mode = self::DIMENSION_MODE_KEEP;
   108         $this->width = $this->height = null;
   117         $clone = clone $this;
   118         $clone->dimension_mode = ($this->height === null) ? self::DIMENSTION_MODE_RESIZE_BY_WIDTH : self::DIMENSTION_MODE_RESIZE_TO_FIXED;
   128         $clone = clone $this;
   129         $clone->dimension_mode = ($this->width === null) ? self::DIMENSTION_MODE_RESIZE_BY_HEIGHT : self::DIMENSTION_MODE_RESIZE_TO_FIXED;
   139         return $this->
withHeight($height)->withWidth($width);
   148         $clone = clone $this;
   161         $clone = clone $this;
   216         if (!preg_match(
'/^#?([a-f0-9]{6})$/i', $background_color)) {
   217             throw new \InvalidArgumentException(
'Invalid background color');
 withCrop(bool $crop)
Crops the final image if needed. 
 
withWidth(int $width)
Resize the image to the given width. 
 
const DIMENSTION_MODE_RESIZE_TO_FIXED
 
withOutputPath(string $output_path)
 
withMakeTemporaryFiles(bool $make_temporary_files)
if passing a stream from memory, make a temporary file for this. 
 
withKeepAspectRatio(bool $keep_aspect_ratio)
Keep the aspect ratio while resizing the image. 
 
withFitIn(int $max_size)
Fit the image into the given size. 
 
withBackgroundColor(string $background_color)
Set a background color for the image. 
 
bool $make_temporary_files
 
withFixedDimensions(int $width, int $height)
Resizes the Image to a fixed size. 
 
withThrowOnError(bool $throw_on_error)
If there is any throwable during convertion, this will be thworn again. 
 
withKeepDimensions(bool $keep)
No resizing, the original image dimension will be used. 
 
const DIMENSION_MODE_KEEP
 
checkBackgroundColor(string $background_color)
 
const DIMENSION_MODE_NONE
 
const DIMENSTION_MODE_RESIZE_BY_HEIGHT
 
const DIMENSTION_MODE_RESIZE_BY_WIDTH
 
withHeight(int $height)
Resize the image to the given height.