19declare(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),
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
166 ->withKeepAspectRatio(
true)
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) {
178 return new ImageConverter(
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());
192 return $this->image_output_options;
withHeight(int $height)
@description Resize the image to the given height.
withWidth(int $width)
@description Resize the image to the given width.
withKeepDimensions(bool $keep)
@description No resizing, the original image dimension will be used.
withQuality(int $image_quality)
@description set the image compression quality.
__construct(bool $throw_on_error=false)
ImageConversionOptions $conversion_options
resizeByWidth(FileStream $stream, int $width, ?ImageOutputOptions $image_output_options=null)
@description Resizes an image to an image with the given width.
convertToFormat(FileStream $stream, string $to_format, ?int $width=null, ?int $height=null, ?ImageOutputOptions $image_output_options=null)
@description Creates an image from the given stream, converted to the desired format.
resizeToFixedSize(FileStream $stream, int $width, int $height, bool $crop_or_otherwise_squeeze=true, ?ImageOutputOptions $image_output_options=null)
@description Creates an image from the given stream, resized to width and height given.
croppedSquare(FileStream $stream, int $square_size, ?ImageOutputOptions $image_output_options=null)
@description Creates an image from the given stream which fits into the given size,...
resizeByHeight(FileStream $stream, int $height, ?ImageOutputOptions $image_output_options=null)
@description Resizes an image to an image with the given height.
ImageOutputOptions $image_output_options
thumbnail(FileStream $stream, int $fit_into_size, ?ImageOutputOptions $image_output_options=null)
@description Creates an image from the given stream which fits into the given size and keeps the aspe...
merge(?ImageOutputOptions $image_output_options)
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
The base interface for all filesystem streams.