19declare(strict_types=1);
77 $clone->width = $clone->height = $max_size;
106 $clone = clone $this;
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;
148 $clone = clone $this;
161 $clone = clone $this;
217 throw new \InvalidArgumentException(
'Invalid background color');
withHeight(int $height)
@description Resize the image to the given height.
withOutputPath(string $output_path)
const DIMENSTION_MODE_RESIZE_TO_FIXED
withMakeTemporaryFiles(bool $make_temporary_files)
@description if passing a stream from memory, make a temporary file for this.
withFixedDimensions(int $width, int $height)
@description Resizes the Image to a fixed size.
const DIMENSTION_MODE_RESIZE_BY_WIDTH
withThrowOnError(bool $throw_on_error)
@description If there is any throwable during convertion, this will be thworn again.
const DIMENSION_MODE_NONE
withCrop(bool $crop)
@description Crops the final image if needed.
withFitIn(int $max_size)
@description Fit the image into the given size.
const DIMENSTION_MODE_RESIZE_BY_HEIGHT
withWidth(int $width)
@description Resize the image to the given width.
withBackgroundColor(string $background_color)
@description Set a background color for the image.
checkBackgroundColor(string $background_color)
withKeepDimensions(bool $keep)
@description No resizing, the original image dimension will be used.
withKeepAspectRatio(bool $keep_aspect_ratio)
@description Keep the aspect ratio while resizing the image.
const DIMENSION_MODE_KEEP
bool $make_temporary_files