Documentation

ImageManipulateInterface

Class implements image manipulation interface.

Table of Contents

Methods

cache()  : $this
Simply processes with no extra methods. Useful for triggering events.
clearAlternatives()  : mixed
Clear out the alternatives.
derivatives()  : $this
Generate alternative image widths, using either an array of integers, or a min width, a max width, and a step parameter to fill out the necessary widths. Existing image alternatives won't be overwritten.
format()  : $this
Sets image output format.
getImagePrettyName()  : string
height()  : $this
Allows to set the height attribute from Markdown or Twig Examples: ![Example](myimg.png?width=200&height=400) ![Example](myimg.png?resize=100,200&width=100&height=200) ![Example](myimg.png?width=auto&height=auto) ![Example](myimg.png?width&height) {{ page.media['myimg.png'].width().height().html }} {{ page.media['myimg.png'].resize(100,200).width(100).height(200).html }}
higherQualityAlternative()  : ImageMediaInterface
Return the image higher quality version
quality()  : int|$this
Sets or gets the quality of the image
setImagePrettyName()  : mixed
Allows the ability to override the image's pretty name stored in cache
sizes()  : string
Set or get sizes parameter for srcset media action
width()  : $this
Allows to set the width attribute from Markdown or Twig Examples: ![Example](myimg.png?width=200&height=400) ![Example](myimg.png?resize=100,200&width=100&height=200) ![Example](myimg.png?width=auto&height=auto) ![Example](myimg.png?width&height) {{ page.media['myimg.png'].width().height().html }} {{ page.media['myimg.png'].resize(100,200).width(100).height(200).html }}

Methods

cache()

Simply processes with no extra methods. Useful for triggering events.

public cache() : $this
Return values
$this

derivatives()

Generate alternative image widths, using either an array of integers, or a min width, a max width, and a step parameter to fill out the necessary widths. Existing image alternatives won't be overwritten.

public derivatives(int|array<string|int, int> $min_width[, int $max_width = 2500 ][, int $step = 200 ]) : $this
Parameters
$min_width : int|array<string|int, int>
$max_width : int = 2500
$step : int = 200
Return values
$this

format()

Sets image output format.

public format(string $format) : $this
Parameters
$format : string
Return values
$this

height()

Allows to set the height attribute from Markdown or Twig Examples: ![Example](myimg.png?width=200&height=400) ![Example](myimg.png?resize=100,200&width=100&height=200) ![Example](myimg.png?width=auto&height=auto) ![Example](myimg.png?width&height) {{ page.media['myimg.png'].width().height().html }} {{ page.media['myimg.png'].resize(100,200).width(100).height(200).html }}

public height([string|int $value = 'auto' ]) : $this
Parameters
$value : string|int = 'auto'

A value or 'auto' or empty to use the height of the image

Return values
$this

quality()

Sets or gets the quality of the image

public quality([int|null $quality = null ]) : int|$this
Parameters
$quality : int|null = null

0-100 quality

Return values
int|$this

setImagePrettyName()

Allows the ability to override the image's pretty name stored in cache

public setImagePrettyName(string $name) : mixed
Parameters
$name : string

sizes()

Set or get sizes parameter for srcset media action

public sizes([string|null $sizes = null ]) : string
Parameters
$sizes : string|null = null
Return values
string

width()

Allows to set the width attribute from Markdown or Twig Examples: ![Example](myimg.png?width=200&height=400) ![Example](myimg.png?resize=100,200&width=100&height=200) ![Example](myimg.png?width=auto&height=auto) ![Example](myimg.png?width&height) {{ page.media['myimg.png'].width().height().html }} {{ page.media['myimg.png'].resize(100,200).width(100).height(200).html }}

public width([string|int $value = 'auto' ]) : $this
Parameters
$value : string|int = 'auto'

A value or 'auto' or empty to use the width of the image

Return values
$this

        
On this page

Search results