ImageManipulateInterface
in
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:     {{ 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:     {{ 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
$thisclearAlternatives()
Clear out the alternatives.
public
clearAlternatives() : mixed
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
$thisformat()
Sets image output format.
public
format(string $format) : $this
Parameters
- $format : string
Return values
$thisgetImagePrettyName()
public
getImagePrettyName() : string
Return values
stringheight()
Allows to set the height attribute from Markdown or Twig Examples:     {{ 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
$thishigherQualityAlternative()
Return the image higher quality version
public
higherQualityAlternative() : ImageMediaInterface
Return values
ImageMediaInterface —the alternative version with higher quality
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|$thissetImagePrettyName()
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
stringwidth()
Allows to set the width attribute from Markdown or Twig Examples:     {{ 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