You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/url-docs/content/en/usage/transformations.md
+24-33Lines changed: 24 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,10 @@ title: Transformations
3
3
description: 'Supported transformation fields'
4
4
position: 5
5
5
category: Usage
6
+
version: 1
6
7
---
7
8
8
-
To transform and optimize your images and videos on delivery, you can pass the following fields to `options.transformations` in each build url method call.
9
+
To transform and optimize your images and videos on delivery, you can pass the following fields to `options.transformations` in each build url method call or `options` in `Transformer.transform` call.
9
10
10
11
<alerttype="info">
11
12
@@ -52,7 +53,7 @@ See [Resize type](https://cloudinary.com/documentation/image_transformation_refe
52
53
53
54
### `rotation`
54
55
55
-
* Type: `String` | `Number`
56
+
* Type: `Rotation`
56
57
* Accepted values: any degree number, or `auto_right` | `auto_left` | `ignore` | `vflip` | `hflip`
57
58
58
59
To rotate or flip a given asset by certain degrees, or automatically based on orientation.
* An available effect or array of effects to apply to asset.
122
130
123
131
Apply a filter or an effect on the desired asset. See[Effects](https://cloudinary.com/documentation/image_transformation_reference#effect_parameter) for the full list of syntax and available effects.
Create a layer below a partial-transparent image. This can be use with `x`, `y`, `gravity` to customize the position of the underlay.
252
+
Create a layer below a partial-transparent image. This can be use with `position.x`, `position.y`, `gravity` to customize the position of the underlay.
See [Transformations](/usage/transformations) for more details on accepted properties for `options`.
42
+
43
+
## `Transformer.toString(transformations)`
44
+
45
+
* `transformations`:
46
+
* Type: `Transformation`
47
+
* Array of transformation params according to Cloudinary format.
48
+
* Output:
49
+
* Type: `String`
50
+
51
+
Returns a string that contains all the given transformations, separated by `,` or `/` and ready to inject to Cloudinary image URL.
52
+
53
+
```js
54
+
import { Transformer } from 'cloudinary-build-url'
55
+
56
+
const trans = Transformer.toString([
57
+
'c_thumb',
58
+
'w_500',
59
+
'h_500',
60
+
'g_auto',
61
+
[ 'e_grayscale' ]
62
+
])
63
+
64
+
console.log(trans)
65
+
//'c_thumb,w_500,h_500,g_auto/e_grayscale'
66
+
```
67
+
68
+
See [Image Transformation API](https://cloudinary.com/documentation/image_transformation_reference) for more details on how to compute transformation params.
0 commit comments