Delivery

Description

Defines transformations for delivering your assets without changing the visual or audio experience for the end user.

Examples

			See the examples under every method
Details

Classes


new DeliveryFormatAction()


new DeliveryColorSpaceFromICCAction( publicId )


new DeliveryDPRAction( dprValue )


new DeliveryQualityAction( qualityValue )


new DeliveryColorSpaceAction( mode )


new DeliveryAction( deliveryKey, deliveryType, modelProperty )

Methods


<static> format( format ) → {Actions.Delivery.DeliveryFormat}

action

Description

Defines the format of the delivered asset.

Learn more: Image formats Video formats

Parameters
Name Type Description
format string

The file format. For a list of supported format types see format types for possible values

Returns
Examples

			import {Cloudinary} from "@cloudinary/url-gen";
			import {format} from "@cloudinary/url-gen/actions/delivery";
			
			const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
			const image = yourCldInstance.image('woman');
			image.delivery(
			 format('jpg'),
			);
Details

<static> dpr( dpr ) → {Actions.Delivery.DeliveryAction}

action

Description

Deliver the image in the specified device pixel ratio.

Parameters
Name Type Description
dpr string

The DPR (Device Pixel Ratio). Any positive float value.

Examples

			import {Cloudinary} from "@cloudinary/url-gen";
			import {dpr} from "@cloudinary/url-gen/actions/delivery";
			
			const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
			const image = yourCldInstance.image('woman');
			image.delivery(
			 dpr('2.0'),
			);
Details

<static> quality( qualityType ) → {Actions.Delivery.DeliveryQualityAction}

action

Description

Controls the quality of the delivered image or video.

Learn more: Image quality Video quality

Parameters
Name Type Description
qualityType QualityTypes | string | number | Qualifiers.Quality

For a list of supported quality types see quality types for possible values.

Examples

			import {Cloudinary} from "@cloudinary/url-gen";
			import {quality} from "@cloudinary/url-gen/actions/delivery";
			import {quality} from "@cloudinary/url-gen/qualifiers/quantity";
			
			const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
			const image = yourCldInstance.image('woman');
			image.delivery(
			 quality('auto'),
			);
Details

<static> density( value ) → {Actions.Delivery.DeliveryAction}

action

Description

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
value number | string

The density in dpi.

Examples

			import {Cloudinary} from "@cloudinary/url-gen";
			import {density} from "@cloudinary/url-gen/actions/delivery";
			
			const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
			const image = yourCldInstance.image('woman');
			image.delivery(
			 density(150),
			);
Details

<static> defaultImage( publicIdWithExtension ) → {Actions.Delivery.DeliveryAction}

action

Description

Default images can be used in the case that a requested image does not exist.

Parameters
Name Type Description
publicIdWithExtension string

Default image public ID

Examples

			import {Cloudinary} from "@cloudinary/url-gen";
			import {defaultImage} from "@cloudinary/url-gen/actions/delivery";
			
			const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
			const image = yourCldInstance.image('woman');
			image.delivery(
			 defaultImage('sample'),
			);
Details

<static> colorSpace( mode ) → {Actions.Delivery.DeliveryAction}

action

Description

Controls the color space used for the delivered image.

Parameters
Name Type Description
mode string | Qualifiers.ColorSpace

The color space.

Examples

			import {Cloudinary} from "@cloudinary/url-gen";
			import {colorSpace} from "@cloudinary/url-gen/actions/delivery";
			import {trueColor} from "@cloudinary/url-gen/qualifiers/colorSpace";
			
			const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
			const image = yourCldInstance.image('woman');
			image.delivery(
			 colorSpace(trueColor()),
			);
Details

<static> colorSpaceFromICC( publicId ) → {Actions.Delivery.DeliveryColorSpaceFromICC}

action

Description

Specifies the ICC profile to use for the color space. The ICC file must be uploaded to your account as a raw, authenticated file.

Parameters
Name Type Description
publicId string

The public ID (including the file extension) of the ICC profile that defines the color space.

Returns
Examples

			import {Cloudinary} from "@cloudinary/url-gen";
			import {colorSpaceFromICC} from "@cloudinary/url-gen/actions/delivery";
			import {trueColor} from "@cloudinary/url-gen/qualifiers/colorSpace";
			
			const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
			const image = yourCldInstance.image('woman');
			image.delivery(
			 colorSpaceFromICC('sample.icc'),
			);
Details