Skip to content

Commit 4448120

Browse files
authored
Merge pull request #105 from imagekit-developer/SDK-94
added parameters
2 parents 81ad0f4 + 8942f95 commit 4448120

File tree

4 files changed

+562
-13625
lines changed

4 files changed

+562
-13625
lines changed

README.md

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@
99

1010
ImageKit Vue.js SDK allows you to use real-time [image resizing](https://docs.imagekit.io/features/image-transformations), [optimization](https://docs.imagekit.io/features/image-optimization), and [file uploading](https://docs.imagekit.io/api-reference/upload-file-api/client-side-file-upload) in client-side.
1111

12-
## Breaking changes - Upgrading from 1.x to 2.x version
12+
## Breaking changes
13+
14+
### Upgrading from 2.x to 3.x version
15+
16+
1. Overlay syntax update
17+
18+
* In version 3.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.
19+
* You can migrate to the new layers syntax using the `raw` transformation parameter.
20+
21+
### Upgrading from 1.x to 2.x version
22+
1323
2.x version has breaking changes as listed below.
1424

1525
1. In version 2.0.1, three global components, namely `ik-image`, `ik-upload`, and `ik-context`, are no longer supported. Instead, it is recommended to import these components individually.
@@ -192,6 +202,15 @@ import { IKImage, IKUpload, IKContext, IKVideo, } from 'imagekitio-vue'
192202
:ref={uploadRef}
193203
:onError={onError}
194204
:onSuccess={onSuccess}
205+
:transformation="{
206+
pre: 'l-text,i-Imagekit,fs-50,l-end',
207+
post: [
208+
{
209+
type: 'transformation',
210+
value: 'w-100'
211+
}
212+
]
213+
}"
195214
/>
196215
</IKContext>
197216
@@ -376,6 +395,28 @@ For example:
376395
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
377396
```
378397
398+
### Arithmetic expressions in transformations
399+
400+
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.
401+
402+
For example:
403+
404+
```js
405+
<IKImage
406+
path="/default-image.jpg"
407+
urlEndpoint="https://ik.imagekit.io/your_imagekit_id/"
408+
:transformation="[{
409+
"height": "ih_div_2",
410+
"width": "iw_div_4",
411+
"border": "cw_mul_0.05_yellow"
412+
}]"
413+
/>
414+
```
415+
416+
**Sample Result URL**
417+
```
418+
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
419+
```
379420
380421
### List of supported transformations
381422
<details>
@@ -410,6 +451,8 @@ https://ik.imagekit.io/your_imagekit_id/tr:h-300,w-400,l-image,i-ik_canvas,bg-FF
410451
| effectUSM | e-usm |
411452
| effectContrast | e-contrast |
412453
| effectGray | e-grayscale |
454+
| effectShadow | e-shadow |
455+
| effectGradient | e-gradient |
413456
| original | orig |
414457
| raw | The string provided in raw will be added to the URL as it is. |
415458
@@ -610,6 +653,15 @@ Sample file upload:
610653
:onError="onError"
611654
:onSuccess="onSuccess"
612655
customCoordinates="10,10,100,100"
656+
:transformation="{
657+
pre: 'l-text,i-Imagekit,fs-50,l-end',
658+
post: [
659+
{
660+
type: 'transformation',
661+
value: 'w-100'
662+
}
663+
]
664+
}"
613665
/>
614666
</template>
615667

@@ -660,6 +712,15 @@ Example Usage
660712
:onError="onError"
661713
:onSuccess="onSuccess"
662714
customCoordinates="10,10,100,100"
715+
:transformation="{
716+
pre: 'l-text,i-Imagekit,fs-50,l-end',
717+
post: [
718+
{
719+
type: 'transformation',
720+
value: 'w-100'
721+
}
722+
]
723+
}"
663724
/>
664725
<button @click="abortChildUpload">Abort Child Upload</button>
665726
</template>

0 commit comments

Comments
 (0)