class Thumbnail (View source)

Properties

protected Image $asset
protected mixed|string $filesystemPath
protected int $width
protected int $height
protected int $realWidth
protected int $realHeight
protected string $mimetype
protected Config $config
protected bool $deferred

Methods

__construct($asset, null $config = null, bool $deferred = true)

No description

mixed|string
getPath(bool $deferredAllowed = true)

No description

mixed|string
getFileSystemPath(bool $deferredAllowed = false)

No description

generate(bool $deferredAllowed = true)

No description

reset()

No description

string
__toString()

Get the public path to the thumbnail image.

int
getWidth()

No description

int
getHeight()

Get the width of the generated thumbnail image in pixels.

int
getRealWidth()

No description

int
getRealHeight()

Get the real width of the generated thumbnail image in pixels. (when using high resolution option)

array
getDimensions()

No description

string
getMimeType()

Get the height of the generated thumbnail image in pixels.

string
getFileExtension()

No description

string
getHTML(array $options = [], array $removeAttributes = [])

Get generated HTML for displaying the thumbnail image in a HTML document. (XHTML compatible).

getMedia(string $name, int $highRes = 1)

No description

getAsset()

No description

getConfig()

Get thumbnail image configuration.

null|string
getChecksum(string $type = 'md5')

No description

createConfig(mixed $selector)

Get a thumbnail image configuration.

Details

__construct($asset, null $config = null, bool $deferred = true)

Parameters

$asset
null $config
bool $deferred

mixed|string getPath(bool $deferredAllowed = true)

Parameters

bool $deferredAllowed

Return Value

mixed|string

mixed|string getFileSystemPath(bool $deferredAllowed = false)

Parameters

bool $deferredAllowed

Return Value

mixed|string

generate(bool $deferredAllowed = true)

Parameters

bool $deferredAllowed

reset()

string __toString()

Get the public path to the thumbnail image.

This method is here for backwards compatility. Up to Pimcore 1.4.8 a thumbnail was returned as a path to an image.

Return Value

string Public path to thumbnail image.

int getWidth()

Return Value

int Width of the generated thumbnail image.

int getHeight()

Get the width of the generated thumbnail image in pixels.

Return Value

int Height of the generated thumbnail image.

int getRealWidth()

Return Value

int real Width of the generated thumbnail image. (when using high resolution option)

int getRealHeight()

Get the real width of the generated thumbnail image in pixels. (when using high resolution option)

Return Value

int Height of the generated thumbnail image.

array getDimensions()

Return Value

array

string getMimeType()

Get the height of the generated thumbnail image in pixels.

Return Value

string HTTP Mime Type of the generated thumbnail image.

string getFileExtension()

Return Value

string

string getHTML(array $options = [], array $removeAttributes = [])

Get generated HTML for displaying the thumbnail image in a HTML document. (XHTML compatible).

Attributes can be added as a parameter. Attributes containing illigal characters are ignored. Width and Height attribute can be overridden. SRC-attribute not. Values of attributes are escaped.

Parameters

array $options Custom configurations and HTML attributes.
array $removeAttributes Listof key-value pairs of HTML attributes that should be removed

Return Value

string IMG-element with at least the attributes src, width, height, alt.

Thumbnail getMedia(string $name, int $highRes = 1)

Parameters

string $name
int $highRes

Return Value

Thumbnail

Exceptions

Exception

Image getAsset()

Return Value

Image The original image from which this thumbnail is generated.

Config getConfig()

Get thumbnail image configuration.

Return Value

Config

null|string getChecksum(string $type = 'md5')

Parameters

string $type

Return Value

null|string

Exceptions

Exception

protected Config createConfig(mixed $selector)

Get a thumbnail image configuration.

Parameters

mixed $selector Name, array or object describing a thumbnail configuration.

Return Value

Config