Skip to content

Commit 195939b

Browse files
committed
Doc final
1 parent 1f11a42 commit 195939b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var imagekit = new ImageKit({
4141
## Usage
4242
You can use this NodeJS SDK for 3 different kinds of functions - URL generation, file uploads and file management. The usage of the SDK has been explained below
4343

44-
### URL Generation
44+
## URL Generation
4545

4646
**1. Using image path and image hostname or endpoint**
4747

@@ -209,7 +209,7 @@ The complete list of transformations supported and their usage in ImageKit can b
209209

210210

211211

212-
### File Upload
212+
## File Upload
213213

214214
The SDK provides a simple interface using the `.upload()` method to upload files to the ImageKit Media Library. It accepts all the parameters supported by the [ImageKit Upload API](https://docs.imagekit.io/imagekit-docs/server-side-file-upload).
215215

@@ -230,7 +230,7 @@ If the upload fails, `error` will be the same as what is received from ImageKit'
230230

231231

232232

233-
### File Management
233+
## File Management
234234

235235
The SDK provides a simple interface for all the [media APIs mentioned here](https://docs.imagekit.io/imagekit-docs/media-api) to manage your files. You can use a callback function with all API interfaces. The first argument of the callback function is the error and the second is the result of the API call. Error will be `null` if the API succeeds.
236236

@@ -312,9 +312,9 @@ imagekit.getPurgeCacheStatus("cache_request_id", function(err, result) {
312312

313313
## Utility functions
314314

315-
We have included following commonly used utility functions in the package.
315+
We have included following commonly used utility functions in this package.
316316

317-
### Authentication Parameter Generation
317+
### Authentication parameter generation
318318

319319
In case you are looking to implement client-side file upload, you are going to need a token, expiry timestamp and a valid signature for that upload. The SDK provides a simple method that you can use in your code to generate these authentication parameters for you.
320320

@@ -335,11 +335,11 @@ Returns
335335

336336
Both the `token` and `expire` parameters are optional. If not specified the SDK uses the [uuid](https://www.npmjs.com/package/uuid) package to generate a random token and also generates a valid expiry timestamp internally. The value of the `token` and `expire` used to generate the signature are always returned in the response, no matter if they are provided as an input to this method or not.
337337

338-
### Distance calculation for two pHashes
338+
### Distance calculation between two pHashe values
339339

340-
Perceptual hashing allows you to constructing a hash value that uniquely identifies an input image based on the contents of an image.
340+
Perceptual hashing allows you to constructing a hash value that uniquely identifies an input image based on the contents of an image. [ImageKit.io metadata API](https://docs.imagekit.io/imagekit-docs/metadata-api) returns the pHash value of an image in the response. You can use this value to find a duplicate (or similar) image by calculating distance between pHash value of two images.
341341

342-
Calculate the distance between pHash strings of two images. Accepts two pHash hexadecimal strings and returns a numeric value indicative of the level of difference between the two images.
342+
This SDK exposes `pHashDistance` function to calcualte distance between two pHash values. It accepts two pHash hexadecimal strings and returns a numeric value indicative of the level of difference between the two images.
343343

344344
```
345345
const calculateDistance = () => {
@@ -352,7 +352,7 @@ const calculateDistance = () => {
352352
return distance;
353353
}
354354
```
355-
#### Distance comparison examples
355+
#### Distance calculation examples
356356

357357
```
358358
imagekit.pHashDistance('f06830ca9f1e3e90', 'f06830ca9f1e3e90');

0 commit comments

Comments
 (0)