ImageOptions
class ImageOptions
ImageOptions allows specifying extended options to the Contentful Image API .
to resize images or change their format.
Methods
ImageOptions constructor.
The urlencoded query string for these options.
Get the width of the image. Will be null if no width is set.
Set the width of the image.
Get the height of the image. Will be null if no height is set.
Set the height of the image.
Format of the image. Possible values are "png" and "jpg". Will be null if no format is set.
Set the format of the image. Valid values are "png" and "jpg". Can be set to null to not enforce a format.
Quality of the JPEG encoded image. Will be null if no quality is set.
Quality of the JPEG encoded image.
Returns true if the image will be loaded as progressive JPEG.
Set to true to load the image as a progressive JPEG.
Details
at line 51
__construct()
ImageOptions constructor.
Empty, only included for forward compatibility.
at line 62
string
getQueryString()
The urlencoded query string for these options.
at line 88
int|null
getWidth()
Get the width of the image. Will be null if no width is set.
at line 109
$this
setWidth(int|null $width = null)
Set the width of the image.
The image will by default not be stretched, skewed or enlarged. Instead it will be fit into the bounding box given by the width and height parameters.
Can be set to null to not set a width.
at line 127
int|null
getHeight()
Get the height of the image. Will be null if no height is set.
at line 148
$this
setHeight(int|null $height = null)
Set the height of the image.
The image will by default not be stretched, skewed or enlarged. Instead it will be fit into the bounding box given by the width and height parameters.
Can be set to null to not set a height.
at line 166
string|null
getFormat()
Format of the image. Possible values are "png" and "jpg". Will be null if no format is set.
at line 186
$this
setFormat(string|null $format = null)
Set the format of the image. Valid values are "png" and "jpg". Can be set to null to not enforce a format.
at line 206
int|null
getQuality()
Quality of the JPEG encoded image. Will be null if no quality is set.
at line 224
$this
setQuality(int|null $quality = null)
Quality of the JPEG encoded image.
The image format will be forced to JPEG.
at line 242
bool
isProgressive()
Returns true if the image will be loaded as progressive JPEG.
at line 256
$this
setProgressive(bool|null $progressive = null)
Set to true to load the image as a progressive JPEG.
The image format will be forced to JPEG.