Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ANKUR DWIVEDI authored and ANKUR DWIVEDI committed Feb 8, 2024
1 parent 638ed21 commit feea8a3
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 627 deletions.
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ImageKit is complete media storage, optimization, and transformation solution th
- [Key Features](#key-features)
- [Requirements](#requirements)
- [Version Support](#version-support)
- [Breaking changes](#breaking-changes)
- [Installation](#installation)
- [Usage](#usage)
- [Getting Started](#getting-started)
Expand Down Expand Up @@ -44,10 +45,20 @@ ImageKit is complete media storage, optimization, and transformation solution th
## Version Support
| SDK Version | PHP 5.4 | PHP 5.5 | PHP 5.6 | PHP 7.x | PHP 8.x |
|-------------|---------|---------|---------|---------|---------|
| 4.x ||| ✔️ | ✔️ |✔️ |
| 3.x ||| ✔️ | ✔️ |✔️ |
| 2.x ||| ✔️ | ✔️ |✔️ |
| 1.x || ✔️ | ✔️ | ✔️ |✔️ |

## Breaking changes

### Upgrading from 3.x to 4.x version

1. Overlay syntax update

* 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.
* You can migrate to the new layers syntax using the `raw` transformation parameter.

## Installation

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

### 6. Signed URL
### 6. Arithmetic expressions in transformations

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.

For example:

```php
$imageURL = $imageKit->url(array(
'path' => '/default-image.jpg',
'urlEndpoint' => 'https://ik.imagekit.io/your_imagekit_id'
'transformation' => [
[
"height": "ih_div_2",
"width": "iw_div_4",
"border": "cw_mul_0.05_yellow"
]
]
));
```

#### Sample Result URL
```
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
``
### 7. Signed URL
For example, the signed URL expires in 300 seconds with the default URL endpoint and other query parameters.
For a detailed explanation of the signed URL, refer to this [documentation](https://docs.imagekit.io/features/security/signed-urls).
Expand Down Expand Up @@ -612,6 +648,15 @@ $uploadFile = $imageKit->uploadFile([
"overwriteAITags" => true, // set to false in order to preserve overwriteAITags
"overwriteTags" => true,
"overwriteCustomMetadata" => true,
'transformation' => [
'pre' => 'l-text,i-Imagekit,fs-50,l-end',
'post' => [
[
'type' => 'transformation',
'value' => 'h-100'
]
]
],
// "customMetadata" => [
// "SKU" => "VS882HJ2JD",
// "price" => 599.99,
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
],
"license": "MIT",
"name": "imagekit/imagekit",
"version": "4.0.0",
"require": {
"php": ">=5.6.0",
"ext-curl": "*",
Expand Down
1 change: 0 additions & 1 deletion sample/url_generation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
echo "\n";

include_once('resize_crop_other_common_transformations.php');
include_once('overlay.php');
include_once('image_enhancement_and_color_manipulation.php');
include_once('chained_transformations.php');
include_once('signed_url.php');
Loading

0 comments on commit feea8a3

Please sign in to comment.