Rotate

Description

Rotates or flips an image or video by the specified number of degrees, or automatically (images only) according to its orientation or available metadata.

Examples

Rotate by mode


			import {Cloudinary} from "@cloudinary/url-gen";
			import {mode, byAngle} from "@cloudinary/url-gen/actions/rotate";
			import {autoLeft} from "@cloudinary/url-gen/qualifiers/rotationMode";
			
			const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
			const image = yourCldInstance.image('woman');
			
			// Rotate by mode
			image.rotate(mode(autoLeft());
			
			// Rotate by angle
			image.rotate(byAngle(90));
			
			image.toURL();
Details

Classes


new RotateAction()

Methods


<static> byAngle( angle ) → {Actions.Rotate.RotateAction}

action

Description

Rotate an image by the given degrees.

Parameters
Name Type Description
angle number

Given degrees. (Range: 0 to 360, Default: 0).


<static> mode( rotationMode ) → {Actions.Rotate.RotateAction}

action

Description

Rotate an image by using a rotationMode

Parameters
Name Type Description
rotationMode RotationModeType | string

For a list of supported rotation modes see types of rotation modes for possible values