trait DeliveryBuilderTrait

Trait DeliveryBuilderTrait

Methods

colorSpace(string $colorSpace)

Controls the color space used for the delivered image.

colorSpaceFromIcc(string $publicId)

Specifies the ICC profile to use for the color space.

format(string|Format|mixed $format)

Sets the file format.

quality(int|Quality|mixed $level, null|string $preset = null)

Controls the compression quality for images and videos.

dpr(Dpr|int|string $dpr)

Deliver the image in the specified device pixel ratio.

density(int|string $density)

Controls the density to use when delivering an image or when converting a vector file such as a PDF or EPS document to a web image delivery format.

defaultImage(DefaultImage|string $defaultImage)

Uses the specified public ID of a placeholder image if the requested image or social network picture does not exist. The name of the placeholder image must include the file extension.

Details

static ColorSpace colorSpace(string $colorSpace)

Controls the color space used for the delivered image.

Use the constants defined in \Cloudinary\Transformation\ColorSpace for $colorSpace.

Parameters

Name Type Description
$colorSpace string The color space. Use the constants defined in the ColorSpace class.

Return Value

ColorSpace

See also

ColorSpace

static ColorSpace colorSpaceFromIcc(string $publicId)

Specifies the ICC profile to use for the color space.

The ICC file must be uploaded to your cloud as a raw, authenticated file.

Alias for ColorSpace::icc

Parameters

Name Type Description
$publicId string The public ID (including the file extension) of the ICC profile that defines the color space.

Return Value

ColorSpace

See also

ColorSpace::icc

static Format format(string|Format|mixed $format)

Sets the file format.

Parameters

Name Type Description
$format string|Format|mixed The file format.

Return Value

Format

static Quality quality(int|Quality|mixed $level, null|string $preset = null)

Controls the compression quality for images and videos.

Reducing the quality is a trade-off between visual quality and file size.

Parameters

Name Type Description
$level int|Quality|mixed The level of the quality. (Range 1 to 100)
$preset null|string A set level of automatic quality. Use the constants defined in the QualityQualifier class.

Return Value

Quality

See also

QualityQualifier

static Dpr dpr(Dpr|int|string $dpr)

Deliver the image in the specified device pixel ratio.

Parameters

Name Type Description
$dpr Dpr|int|string The DPR (Device Pixel Ratio). Any positive float value.

Return Value

Dpr

static Density density(int|string $density)

Controls the density to use when delivering an image or when converting a vector file such as a PDF or EPS document to a web image delivery format.

Parameters

Name Type Description
$density int|string The density in dpi.

Return Value

Density

static DeliveryBuilderTrait defaultImage(DefaultImage|string $defaultImage)

Uses the specified public ID of a placeholder image if the requested image or social network picture does not exist. The name of the placeholder image must include the file extension.

Parameters

Name Type Description
$defaultImage DefaultImage|string The public ID with extension of the placeholder image.

Return Value

DeliveryBuilderTrait

See also

DefaultImage