You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-12Lines changed: 24 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,9 +58,21 @@ Step 2. Add the dependency in POM file:
58
58
59
59
60
60
## Initialization
61
+
62
+
Step 1. Create a `config.properties` file inside `src/main/resources` of your project. And put essential values of keys [UrlEndpoint, PrivateKey, PublicKey], no need to use any quote(',") in values.
63
+
64
+
```editorconfig
65
+
# Put essential values of keys [UrlEndpoint, PrivateKey, PublicKey]
66
+
UrlEndpoint=<-YOUR-ENDPOINT-URL-HERE->
67
+
PrivateKey=<-YOUR-PRIVATE-KEY-HERE->
68
+
PublicKey=<-YOUR-PUBLIC-KEY-HERE->
69
+
```
70
+
Step 2. Then you need to initialize ImageKit with that configuration.
71
+
61
72
```java
62
73
importio.imagekit.sdk.ImageKit;
63
74
importio.imagekit.sdk.config.Configuration;
75
+
importio.imagekit.sdk.utils.Utils;
64
76
classApp {
65
77
publicstaticvoidmain(String[] args){
66
78
ImageKit imageKit=ImageKit.getInstance();
@@ -134,14 +146,14 @@ The ```.getUrl()``` method accepts the following parameters
|url_endpoint| Optional. `(Type: String)` The base URL to be appended before the path of the image. If not specified, the URL Endpoint specified at the time of SDK initialization is used. For example, https://ik.imagekit.io/your_imagekit_id/|
149
+
|urlEndpoint| Optional. `(Type: String)` The base URL to be appended before the path of the image. If not specified, the URL Endpoint specified at the time of SDK initialization is used. For example, https://ik.imagekit.io/your_imagekit_id/|
138
150
| path | Conditional. `(Type: String)` This is the path at which the image exists. For example, `/path/to/image.jpg`. Either the `path` or `src` parameter needs to be specified for URL generation. |
139
151
| src | Conditional. `(Type: String)` This is the complete URL of an image already mapped to ImageKit. For example, `https://ik.imagekit.io/your_imagekit_id/endpoint/path/to/image.jpg`. Either the `path` or `src` parameter needs to be specified for URL generation. |
140
152
| transformation | Optional. `(Type: List<Map<String,String>>)` An array of objects specifying the transformation to be applied in the URL. The transformation name and the value should be specified as a key-value pair in the object. Different steps of a [chained transformation](https://docs.imagekit.io/features/image-transformations/chained-transformations) can be specified as different objects of the array. The complete list of supported transformations in the SDK and some examples of using them are given later. If you use a transformation name that is not specified in the SDK, it gets applied as it is in the URL. |
141
-
|transformation_position| Optional. `(Type: String)` Default value is `path` that places the transformation string as a path parameter in the URL. It can also be specified as `query` which adds the transformation string as the query parameter `tr` in the URL. If you use the `src` parameter to create the URL, then the transformation string is always added as a query parameter. |
142
-
|query_parameters| Optional. `(Type: Map<String, String>)` These are the other query parameters that you want to add to the final URL. These can be any query parameters and not necessarily related to ImageKit. Especially useful if you want to add some versioning parameter to your URLs. |
153
+
|transformationPosition| Optional. `(Type: String)` Default value is `path` that places the transformation string as a path parameter in the URL. It can also be specified as `query` which adds the transformation string as the query parameter `tr` in the URL. If you use the `src` parameter to create the URL, then the transformation string is always added as a query parameter. |
154
+
|queryParameters| Optional. `(Type: Map<String, String>)` These are the other query parameters that you want to add to the final URL. These can be any query parameters and not necessarily related to ImageKit. Especially useful if you want to add some versioning parameter to your URLs. |
143
155
| signed | Optional. `(Type: Boolean)` Default is `false`. If set to `true`, the SDK generates a signed image URL adding the image signature to the image URL. This can only be used if you are creating the URL with the `url_endpoint` and `path` parameters, and not with the `src` parameter. |
144
-
|expire_seconds| Optional. `(Type: Integer)` Meant to be used along with the `signed` parameter to specify the time in seconds from now when the URL should expire. If specified, the URL contains the expiry timestamp in the URL, and the image signature is modified accordingly. |
156
+
|expireSeconds| Optional. `(Type: Integer)` Meant to be used along with the `signed` parameter to specify the time in seconds from now when the URL should expire. If specified, the URL contains the expiry timestamp in the URL, and the image signature is modified accordingly. |
145
157
146
158
147
159
## Examples of generating URLs
@@ -329,13 +341,13 @@ in the [documentation here](https://docs.imagekit.io/api-reference/media-api/lis
0 commit comments