DerivativeWatermarkService
in package
Table of Contents
Constants
- USAGE_MASTER = 140
- USAGE_REFERENCE = 141
- USAGE_THUMBNAIL = 142
Methods
- applyWatermark() : bool
- Apply watermark to a derivative image file.
- getCustomWatermarks() : array<string|int, mixed>
- Get custom watermarks (global and for specific object).
- getWatermarkConfig() : array<string|int, mixed>|null
- Get watermark configuration for an object.
- regenerateDerivatives() : bool
- Regenerate watermarked derivatives for an object.
- uploadCustomWatermark() : int|null
- Upload a custom watermark.
Constants
USAGE_MASTER
public
mixed
USAGE_MASTER
= 140
USAGE_REFERENCE
public
mixed
USAGE_REFERENCE
= 141
USAGE_THUMBNAIL
public
mixed
USAGE_THUMBNAIL
= 142
Methods
applyWatermark()
Apply watermark to a derivative image file.
public
static applyWatermark(string $imagePath, int $objectId) : bool
Parameters
- $imagePath : string
- $objectId : int
Return values
boolgetCustomWatermarks()
Get custom watermarks (global and for specific object).
public
static getCustomWatermarks([int|null $objectId = null ]) : array<string|int, mixed>
Parameters
- $objectId : int|null = null
Return values
array<string|int, mixed>getWatermarkConfig()
Get watermark configuration for an object.
public
static getWatermarkConfig(int $objectId) : array<string|int, mixed>|null
Priority: Security > Custom > Selected > Default
Parameters
- $objectId : int
Return values
array<string|int, mixed>|nullregenerateDerivatives()
Regenerate watermarked derivatives for an object.
public
static regenerateDerivatives(int $objectId) : bool
This recreates reference/thumbnail from master with new watermark.
Parameters
- $objectId : int
Return values
booluploadCustomWatermark()
Upload a custom watermark.
public
static uploadCustomWatermark(array<string|int, mixed> $file, string $name[, int|null $objectId = null ][, string $position = 'center' ][, float $opacity = 0.4 ][, int $userId = 0 ]) : int|null
Parameters
- $file : array<string|int, mixed>
- $name : string
- $objectId : int|null = null
- $position : string = 'center'
- $opacity : float = 0.4
- $userId : int = 0