19declare(strict_types=1);
38 public const ID =
'badge_image_resize_machine';
64 return ImagickEngine::class;
73 $this->definition = $for_definition;
77 foreach ($for_definition->getWidths() as $width) {
92 $quality = $size <= self::FULL_QUALITY_SIZE_THRESHOLD
94 : $this->definition->getQuality();
96 return $this->crop->processStream(
104 )->current()->getStream();
canHandleDefinition(FlavourDefinition $definition)
Check if a corresponding configuration can be processed by this Machine.
__construct()
FlavourMachines must be able to be created without further dependencies.
cropImage(FileStream $stream, int $size)
FileInformation $information
const FULL_QUALITY_SIZE_THRESHOLD
dependsOnEngine()
Return the class name of the Engine that is required for this Machine to work.
ilBadgePictureDefinition $definition
ExtractPages $extract_pages
The base interface for all filesystem streams.
processStream(FileInformation $information, FileStream $stream, FlavourDefinition $for_definition)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
trait GdImageToStreamTrait