Skip to content

Commit 76e08cc

Browse files
ANKUR DWIVEDIANKUR DWIVEDI
authored andcommitted
updated readme
1 parent a4eb592 commit 76e08cc

File tree

1 file changed

+71
-1
lines changed

1 file changed

+71
-1
lines changed

README.md

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,17 @@ ImageKit Angular SDK allows you to resize, optimize, deliver, and upload images
1111

1212
ImageKit is complete media storage, optimization, and transformation solution that comes with an image and video CDN. It can be integrated with your existing infrastructure - storage like AWS S3, web servers, your CDN, and custom domain names, allowing you to deliver optimized images in minutes with minimal code changes.
1313

14-
## Breaking changes - Upgrading from 2.x to 3.x version
14+
## Breaking changes -
15+
16+
### Upgrading from 3.x to 4.x version
17+
18+
1. Overlay syntax update
19+
20+
* In version 4.0.0, we've removed the old overlay syntax parameters for transformations, such as `oi`, `ot`, `obg`, and [more](https://docs.imagekit.io/features/image-transformations/overlay). These parameters are deprecated and will start returning errors when used in URLs. Please migrate to the new layers syntax that supports overlay nesting, provides better positional control, and allows more transformations at the layer level. You can start with [examples](https://docs.imagekit.io/features/image-transformations/overlay-using-layers#examples) to learn quickly.
21+
* You can migrate to the new layers syntax using the `raw` transformation parameter.
22+
23+
### Upgrading from 2.x to 3.x version
24+
1525
3.x version has breaking changes as listed below.
1626
* In version 3.0.0, we have deprecated the use of the `authenticationEndpoint` parameter. Instead, the SDK now introduces a new parameter named `authenticator`. This parameter expects an asynchronous function that resolves with an object containing the necessary security parameters i.e `signature`, `token`, and `expire`.
1727

@@ -190,6 +200,15 @@ To use the SDK, you need to provide it with a few configuration parameters. The
190200
[onUploadStart]="onUploadStartFunction"
191201
[onUploadProgress]="onUploadProgressFunction"
192202
[authenticator]="authenticator"
203+
[transformation]="{
204+
'pre': 'l-text,i-Imagekit,fs-50,l-end',
205+
'post': [
206+
{
207+
'type': 'transformation',
208+
'value': 'w-100'
209+
}
210+
]
211+
}"
193212
></ik-upload>
194213
```
195214

@@ -389,6 +408,30 @@ You can lazy-load the original image only when the user scrolls near them. Until
389408
</ik-image>
390409
```
391410

411+
### Arithmetic expressions in transformations
412+
413+
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.
414+
415+
For example:
416+
417+
```js
418+
<ik-image
419+
path="/default-image.jpg"
420+
loading= "lazy"
421+
[transformation]='[{
422+
"height": "ih_div_2",
423+
"width": "iw_div_4",
424+
"border": "cw_mul_0.05_yellow"
425+
}]'
426+
>
427+
</ik-image>
428+
```
429+
430+
**Sample Result URL**
431+
```
432+
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
433+
```
434+
392435
## ik-video
393436

394437
The `ik-video` component renders a `video` tag. It is used for rendering and manipulating videos in real time. `ik-video` component accepts the following props:
@@ -506,6 +549,15 @@ validateFileFunction(res: File) {
506549
[validateFile]="validateFileFunction"
507550
[onUploadStart]="onUploadStartFunction"
508551
[onUploadProgress]="onUploadProgressFunction"
552+
[transformation]="{
553+
'pre': 'l-text,i-Imagekit,fs-50,l-end',
554+
'post': [
555+
{
556+
'type': 'transformation',
557+
'value': 'w-100'
558+
}
559+
]
560+
}"
509561
>
510562
</ik-upload>
511563
```
@@ -522,6 +574,15 @@ Custom button example, using buttonRef
522574
[onUploadStart]="onUploadStartFunction"
523575
[onUploadProgress]="onUploadProgressFunction"
524576
[buttonRef]="myBtn"
577+
[transformation]="{
578+
'pre': 'l-text,i-Imagekit,fs-50,l-end',
579+
'post': [
580+
{
581+
'type': 'transformation',
582+
'value': 'w-100'
583+
}
584+
]
585+
}"
525586
>
526587
</ik-upload>
527588

@@ -551,6 +612,15 @@ onAbortFunction(){
551612
[onUploadStart]="onUploadStartFunction"
552613
[onUploadProgress]="onUploadProgressFunction"
553614
[authenticator]="authenticator"
615+
[transformation]="{
616+
'pre': 'l-text,i-Imagekit,fs-50,l-end',
617+
'post': [
618+
{
619+
'type': 'transformation',
620+
'value': 'w-100'
621+
}
622+
]
623+
}"
554624
></ik-upload>
555625
<button
556626
(click)="onAbortFunction()"

0 commit comments

Comments
 (0)