19 declare(strict_types=1);
38 bool $throw_on_error =
false 42 ->withMakeTemporaryFiles(
false)
43 ->withThrowOnError($throw_on_error);
59 $this->conversion_options
60 ->withFitIn($fit_into_size)
62 ->withKeepAspectRatio(
true),
63 $this->
merge($image_output_options),
78 $this->conversion_options
79 ->withFitIn($square_size)
80 ->withKeepAspectRatio(
true)
82 $this->
merge($image_output_options),
99 $this->conversion_options
101 ->withKeepAspectRatio(
true),
102 $this->
merge($image_output_options),
119 $this->conversion_options
120 ->withHeight($height)
121 ->withKeepAspectRatio(
true),
122 $this->
merge($image_output_options),
137 bool $crop_or_otherwise_squeeze =
true,
141 $this->conversion_options
143 ->withHeight($height)
144 ->withCrop($crop_or_otherwise_squeeze)
145 ->withKeepAspectRatio(
true),
146 $this->
merge($image_output_options),
165 $conversion_options = $this->conversion_options
169 if ($height !==
null) {
170 $conversion_options = $conversion_options->
withHeight($height);
172 if ($width !==
null) {
173 $conversion_options = $conversion_options->
withWidth($width);
175 if ($width ===
null && $height ===
null) {
180 $this->
merge($image_output_options)->withFormat($to_format),
187 if ($image_output_options !==
null) {
188 return $this->image_output_options
190 ->withFormat($image_output_options->
getFormat());
withWidth(int $width)
Resize the image to the given width.
withKeepAspectRatio(bool $keep_aspect_ratio)
Keep the aspect ratio while resizing the image.
convertToFormat(FileStream $stream, string $to_format, ?int $width=null, ?int $height=null, ?ImageOutputOptions $image_output_options=null)
Creates an image from the given stream, converted to the desired format.
croppedSquare(FileStream $stream, int $square_size, ?ImageOutputOptions $image_output_options=null)
Creates an image from the given stream which fits into the given size, but is cropped to fill the who...
ImageConversionOptions $conversion_options
withKeepDimensions(bool $keep)
No resizing, the original image dimension will be used.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
resizeToFixedSize(FileStream $stream, int $width, int $height, bool $crop_or_otherwise_squeeze=true, ?ImageOutputOptions $image_output_options=null)
Creates an image from the given stream, resized to width and height given.
withQuality(int $image_quality)
set the image compression quality.
resizeByHeight(FileStream $stream, int $height, ?ImageOutputOptions $image_output_options=null)
Resizes an image to an image with the given height.
__construct(bool $throw_on_error=false)
ImageOutputOptions $image_output_options
merge(?ImageOutputOptions $image_output_options)
thumbnail(FileStream $stream, int $fit_into_size, ?ImageOutputOptions $image_output_options=null)
Creates an image from the given stream which fits into the given size and keeps the aspect ratio...
resizeByWidth(FileStream $stream, int $width, ?ImageOutputOptions $image_output_options=null)
Resizes an image to an image with the given width.
The base interface for all filesystem streams.
withHeight(int $height)
Resize the image to the given height.