Skip to content

Commit 23229d6

Browse files
ANKUR DWIVEDIANKUR DWIVEDI
authored andcommitted
added example for expressions
1 parent 45d2dc3 commit 23229d6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,27 @@ var imageURL = imagekit.url({
260260
https://ik.imagekit.io/your_imagekit_id/tr:h-300,w-400,l-image,i-ik_canvas,bg-FF0000,w-300,h-100,l-end/img/sample-video.mp4
261261
```
262262

263+
**3. Arithmetic expressions In transformations**
264+
265+
ImageKit allows use of [arithmetic expressions](https://docs.imagekit.io/features/arithmetic-expressions-in-transformations) in certain dimension and position-related parameters, making media transformations more flexible and dynamic.
266+
267+
For example:
268+
269+
```js
270+
var imageURL = imagekit.url({
271+
src: "https://ik.imagekit.io/your_imagekit_id/default-image.jpg",
272+
transformation: [{
273+
"width": "iw_div_4",
274+
"height": "ih_div_2",
275+
"border": "cw_mul_0.05_yellow"
276+
}]
277+
});
278+
```
279+
280+
**Sample Result URL**
281+
```
282+
https://ik.imagekit.io/your_imagekit_id/default-image.jpg?tr=w-iw_div_4,h-ih_div_2:b-cw_mul_0.05_yellow
283+
```
263284

264285
#### List of supported transformations
265286

0 commit comments

Comments
 (0)