class ThumbnailGenerator

Generate thumbnails and thumbnail links

Traits

Provides extensions to this object to integrate it with standard config API methods.

Constants

INLINE

Thumbnails are inline

URL

Thumbnails are linked by url

Config options

max_thumbnail_bytes int Safely limit max inline thumbnail size to 200kb.
thumbnail_links array Determine how thumbnails are serialised List of visibility to either 'inline' or 'url' form.
method string

Methods

static Config_ForClass
config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .

mixed
stat(string $name) deprecated

Get inherited config value

mixed
uninherited(string $name)

Gets the uninherited value for the given config option

$this
set_stat(string $name, mixed $value) deprecated

Update the config value for a given property

string|null
generateThumbnailLink(AssetContainer $file, int $width, int $height, bool $graceful = false)

Generate thumbnail and return the "src" property for this thumbnail

generateThumbnail(AssetContainer $file, int $width, int $height)

Generate thumbnail object

string
generateLink(AssetContainer $thumbnail = null)

Generate "src" property for this thumbnail.

bool
getGenerates()

No description

$this
setGenerates(bool $generates)

No description

Details

in Configurable at line 20
static Config_ForClass config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .

....).

Return Value

Config_ForClass

in Configurable at line 32
mixed stat(string $name) deprecated

deprecated 5.0 Use ->config()->get() instead

Get inherited config value

Parameters

string $name

Return Value

mixed

in Configurable at line 44
mixed uninherited(string $name)

Gets the uninherited value for the given config option

Parameters

string $name

Return Value

mixed

in Configurable at line 57
$this set_stat(string $name, mixed $value) deprecated

deprecated 5.0 Use ->config()->set() instead

Update the config value for a given property

Parameters

string $name
mixed $value

Return Value

$this

Generate thumbnail and return the "src" property for this thumbnail

Parameters

AssetContainer $file
int $width
int $height
bool $graceful If true, null result will fallback on URL

Return Value

string|null

at line 99
AssetContainer|DBFile|File generateThumbnail(AssetContainer $file, int $width, int $height)

Generate thumbnail object

Parameters

AssetContainer $file
int $width
int $height

Return Value

AssetContainer|DBFile|File

Generate "src" property for this thumbnail.

This can be either a url or base64 encoded data

Parameters

AssetContainer $thumbnail

Return Value

string

at line 162
bool getGenerates()

Return Value

bool

at line 171
$this setGenerates(bool $generates)

Parameters

bool $generates

Return Value

$this