Classes
Methods
-
<static> compass( direction ) → {CompassGravity}
-
Description
Defines the gravity based on directional values from a compass. Learn more: Control gravity for images Learn more: Control gravity for videos
Parameters
Name Type Description direction
Qualifiers.Compass | string A compass Values
Returns
Examples
import {Cloudinary} from "@cloudinary/url-gen"; import {compass} from "@cloudinary/url-gen/qualifiers/gravity"; import {north} from "@cloudinary/url-gen/qualifiers/compass"; import {crop} from "@cloudinary/url-gen/actions/resize"; const yourCldInstance = new Cloudinary({cloud: {cloudName: 'demo'}}); const image = yourCldInstance.image('woman'); image.resize(crop().width(300).gravity(compass(north())))
Details
-
<static> focusOn( ...args ) → {FocusOnGravity}
qualifier
-
Description
Specifies what to focus on, for example: faces, objects, eyes, etc.
Parameters
Name Type Attributes Description args
Qualifier.FocusOn <repeatable> One or more objects to focus on
Returns
Examples
import {Cloudinary} from "@cloudinary/url-gen"; import {focusOn} from "@cloudinary/url-gen/qualifiers/gravity"; import {crop} from "@cloudinary/url-gen/actions/resize"; import {cat} from "@cloudinary/url-gen/qualifiers/focusOn"; const yourCldInstance = new Cloudinary({cloud: {cloudName: 'demo'}}); const image = yourCldInstance.image('woman'); image.resize(crop().width(300).gravity(focusOn(cat())))
Details
-
<static> autoGravity() → {Qualifiers.Gravity.AutoGravity}
qualifier
-
Description
Automatically identifies the most interesting regions in the asset, can be qualified further by including what to focus on.
Returns
Examples
import {Cloudinary} from "@cloudinary/url-gen"; import {autoGravity} from "@cloudinary/url-gen/qualifiers/gravity"; import {crop} from "@cloudinary/url-gen/actions/resize"; const yourCldInstance = new Cloudinary({cloud: {cloudName: 'demo'}}); const image = yourCldInstance.image('woman'); image.resize(crop().width(300).gravity(autoGravity()))
import {Cloudinary} from "@cloudinary/url-gen"; import {autoGravity} from "@cloudinary/url-gen/qualifiers/gravity"; import {crop} from "@cloudinary/url-gen/actions/resize"; import {cat} from "@cloudinary/url-gen/qualifiers/focusOn"; import {AutoFocus} from "@cloudinary/url-gen/qualifiers/autoFocus"; const yourCldInstance = new Cloudinary({cloud: {cloudName: 'demo'}}); const image = yourCldInstance.image('woman'); image.resize(crop().width(300).gravity(autoGravity().autoFocus(AutoFocus.focusOn(cat()))))
Details
-
<static> xyCenter() → {XYCenterGravity}
qualifier
-
Description
Set the center of gravity to the given x & y coordinates.
Returns
Details