ImageService
Read onlyYes
Service for processing images
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Properties
Methods
- __construct() : mixed
- applyProcessingInstructions() : ProcessedFile
- Create a processed file
- getImage() : FileInterface|ProcessableFileInterface
- Get File or FileReference object
- getImageUri() : string
- Get public url of image depending on the environment
Properties
$resourceFactory
protected
ResourceFactory
$resourceFactory
Methods
__construct()
public
__construct(ResourceFactory $resourceFactory) : mixed
Parameters
- $resourceFactory : ResourceFactory
applyProcessingInstructions()
Create a processed file
public
applyProcessingInstructions(ProcessableFileInterface $image, array<string|int, mixed> $processingInstructions) : ProcessedFile
Parameters
- $image : ProcessableFileInterface
- $processingInstructions : array<string|int, mixed>
Return values
ProcessedFilegetImage()
Get File or FileReference object
public
getImage(string $src, FileInterface|FileReference|null $image, bool $treatIdAsReference) : FileInterface|ProcessableFileInterface
Parameters
- $src : string
- $image : FileInterface|FileReference|null
- $treatIdAsReference : bool
Tags
Return values
FileInterface|ProcessableFileInterfacegetImageUri()
Get public url of image depending on the environment
public
getImageUri(FileInterface $image[, bool|false $absolute = false ]) : string
Parameters
- $image : FileInterface
- $absolute : bool|false = false
-
Force absolute URL