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() : File|FileReference
- 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(File|FileReference $image, array<string|int, mixed> $processingInstructions) : ProcessedFile
Parameters
- $image : File|FileReference
- $processingInstructions : array<string|int, mixed>
Return values
ProcessedFilegetImage()
Get File or FileReference object
public
getImage(string $src, FileInterface|FileReference|null $image, bool $treatIdAsReference) : File|FileReference
Parameters
- $src : string
- $image : FileInterface|FileReference|null
- $treatIdAsReference : bool
Tags
Return values
File|FileReferencegetImageUri()
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