Skip to content

Commit feea8a3

Browse files
ANKUR DWIVEDIANKUR DWIVEDI
authored andcommitted
updated readme
1 parent 638ed21 commit feea8a3

File tree

4 files changed

+47
-627
lines changed

4 files changed

+47
-627
lines changed

README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ImageKit is complete media storage, optimization, and transformation solution th
1010
- [Key Features](#key-features)
1111
- [Requirements](#requirements)
1212
- [Version Support](#version-support)
13+
- [Breaking changes](#breaking-changes)
1314
- [Installation](#installation)
1415
- [Usage](#usage)
1516
- [Getting Started](#getting-started)
@@ -44,10 +45,20 @@ ImageKit is complete media storage, optimization, and transformation solution th
4445
## Version Support
4546
| SDK Version | PHP 5.4 | PHP 5.5 | PHP 5.6 | PHP 7.x | PHP 8.x |
4647
|-------------|---------|---------|---------|---------|---------|
48+
| 4.x ||| ✔️ | ✔️ |✔️ |
4749
| 3.x ||| ✔️ | ✔️ |✔️ |
4850
| 2.x ||| ✔️ | ✔️ |✔️ |
4951
| 1.x || ✔️ | ✔️ | ✔️ |✔️ |
5052

53+
## Breaking changes
54+
55+
### Upgrading from 3.x to 4.x version
56+
57+
1. Overlay syntax update
58+
59+
* 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.
60+
* You can migrate to the new layers syntax using the `raw` transformation parameter.
61+
5162
## Installation
5263

5364
You can install the bindings via [Composer](http://getcomposer.org/). Run the following command:
@@ -441,7 +452,32 @@ $imageURL = $imageKit->url(array(
441452
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
442453
```
443454

444-
### 6. Signed URL
455+
### 6. Arithmetic expressions in transformations
456+
457+
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.
458+
459+
For example:
460+
461+
```php
462+
$imageURL = $imageKit->url(array(
463+
'path' => '/default-image.jpg',
464+
'urlEndpoint' => 'https://ik.imagekit.io/your_imagekit_id'
465+
'transformation' => [
466+
[
467+
"height": "ih_div_2",
468+
"width": "iw_div_4",
469+
"border": "cw_mul_0.05_yellow"
470+
]
471+
]
472+
));
473+
```
474+
475+
#### Sample Result URL
476+
```
477+
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
478+
``
479+
480+
### 7. Signed URL
445481
446482
For example, the signed URL expires in 300 seconds with the default URL endpoint and other query parameters.
447483
For a detailed explanation of the signed URL, refer to this [documentation](https://docs.imagekit.io/features/security/signed-urls).
@@ -612,6 +648,15 @@ $uploadFile = $imageKit->uploadFile([
612648
"overwriteAITags" => true, // set to false in order to preserve overwriteAITags
613649
"overwriteTags" => true,
614650
"overwriteCustomMetadata" => true,
651+
'transformation' => [
652+
'pre' => 'l-text,i-Imagekit,fs-50,l-end',
653+
'post' => [
654+
[
655+
'type' => 'transformation',
656+
'value' => 'h-100'
657+
]
658+
]
659+
],
615660
// "customMetadata" => [
616661
// "SKU" => "VS882HJ2JD",
617662
// "price" => 599.99,

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
],
2525
"license": "MIT",
2626
"name": "imagekit/imagekit",
27+
"version": "4.0.0",
2728
"require": {
2829
"php": ">=5.6.0",
2930
"ext-curl": "*",

sample/url_generation/index.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
echo "\n";
77

88
include_once('resize_crop_other_common_transformations.php');
9-
include_once('overlay.php');
109
include_once('image_enhancement_and_color_manipulation.php');
1110
include_once('chained_transformations.php');
1211
include_once('signed_url.php');

0 commit comments

Comments
 (0)