Skip to content

Commit def5bea

Browse files
committed
grammerly check
1 parent 26441df commit def5bea

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ ImageKitIo.configure do |config|
6262
end
6363
```
6464
#### CarrierWave
65-
You can create a carrierwave uploader in order to attach pictures to your database objects as their attributes. To upload images without designating them as database attributes, skip to [this section](https://github.com/imagekit-developer/imagekit-ruby#file-upload).
66-
(make sure to add service `:carrierwave` as shown in [initialization section](#Initialization))
65+
You can create a CarrierWave uploader to attach pictures to your database objects as their attributes. Skip to [this section](https://github.com/imagekit-developer/imagekit-ruby#file-upload) to upload images without designating them as database attributes. Make sure to add service `:carrierwave` as shown in [initialization section](#initialization).
66+
6767
```bash
6868
rails g uploader <Uploading_attribute_name>
6969
# For example, if you want to create an uploader for Avatar attribute, then use
@@ -137,7 +137,7 @@ Get image url:
137137
@employee.avatar.url
138138
```
139139

140-
Now lets configure active_storage as a service for the imagekitio.
140+
Now, let's configure active_storage as a service for the imagekitio.
141141

142142
First add `:active_storage` in initializer file.
143143

@@ -155,7 +155,7 @@ imagekitio:
155155

156156
## Usage
157157

158-
You can use this Ruby SDK for three different kinds of methods - URL generation, file upload, and file management.
158+
You can use this Ruby SDK for three different methods - URL generation, file upload, and file management.
159159

160160
The usage of the SDK has been explained below.
161161

@@ -185,8 +185,7 @@ https://ik.imagekit.io/your_imagekit_id/endpoint/tr:h-300,w-400,ar-4-3,q-40/defa
185185
```
186186

187187
**2.Using full image URL**
188-
This method allows you to add transformation parameters to an existing, complete URL that is already mapped to ImageKit
189-
using `src` parameter. This method should be used if you have the complete image URL mapped to ImageKit stored in your
188+
This method allows you to add transformation parameters to an existing, complete URL already mapped to ImageKit using the `src` parameter. This method should be used if you have the complete image URL mapped to ImageKit stored in your
190189
database.
191190

192191

@@ -213,7 +212,7 @@ The `.url()` method accepts the following parameters
213212
| src | Conditional. 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. |
214213
| transformation | Optional. 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. |
215214
| transformation_position | Optional. The 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 `src` parameter to create the URL, then the transformation string is always added as a query parameter. |
216-
| query_parameters | Optional. 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. |
215+
| query_parameters | Optional. 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 parameters to your URLs. |
217216
| signed | Optional. 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. |
218217
| expire_seconds | Optional. 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. |
219218

@@ -289,8 +288,10 @@ https://ik.imagekit.io/your_imagekit_id/tr:h-300,w-400/default-image.jpg?v=123&i
289288

290289
The complete list of transformations supported and their usage in ImageKit can be found [here](https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations).
291290
The SDK gives a name to each transformation parameter, making the code simpler, making the code simpler, and readable.
292-
If a transformation is supported in ImageKit, but a name for it cannot be found in the table below, then use the
293-
transformation code from ImageKit docs as the name when using the `url` function.
291+
292+
If a transformation is supported in ImageKit, but a name for it cannot be found in the table below, then use the transformation code from ImageKit docs as the name when using the `url` function.
293+
294+
If you want to generate transformations in your application and add them to the URL as it is, use the `raw` parameter.
294295

295296
| Supported Transformation Name | Translates to parameter |
296297
|-------------------------------|-------------------------|
@@ -489,7 +490,7 @@ imagekitio.delete_bulk_files(
489490
```
490491

491492
**10. Purge Cache**
492-
Programmatically issue a cache clear request as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/purge-cache).
493+
Programmatically issue a clear cache request as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/purge-cache).
493494
Accepts the full URL of the file for which the cache has to be cleared.
494495

495496
```ruby
@@ -510,7 +511,7 @@ imagekitio.purge_file_cache_status(
510511

511512
**12. Add Bulk Tags**
512513

513-
Add multiple tags on multiple files using array of file ids and array of tags as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/add-tags-bulk)
514+
Add multiple tags on multiple files using an array of file ids and an array of tags as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/add-tags-bulk)
514515

515516
```ruby
516517
imagekitio.add_bulk_tags(
@@ -521,7 +522,7 @@ imagekitio.add_bulk_tags(
521522

522523
**13. Delete Bulk Tags**
523524

524-
Remove multiple tags from multiple files using array of file ids and array of tags as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/remove-tags-bulk)
525+
Remove multiple tags from multiple files using an array of file ids and an array of tags as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/remove-tags-bulk)
525526

526527
```ruby
527528
imagekitio.delete_bulk_tags(
@@ -651,7 +652,7 @@ We have included the following commonly used utility functions in this package.
651652

652653
**Authentication parameter generation**
653654

654-
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.
655+
If you are looking to implement client-side file upload, you will 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.
655656

656657
_Note: The Private API Key should never be exposed in any client-side code. You must always generate these authentication parameters on the server-side_
657658

@@ -677,7 +678,7 @@ value of an image in the response. You can use this value to find a duplicate ne
677678
the distance between the two images.
678679

679680

680-
This SDK exposes the `phash_distance` function to calculate the distance between two pHash value. It accepts two pHash hexadecimal
681+
This SDK exposes the `phash_distance` function to calculate the distance between two pHash values. It accepts two pHash hexadecimal
681682
strings and returns a numeric value indicative of the level of difference between the two images.
682683

683684
```ruby
@@ -707,6 +708,7 @@ imagekitio.phash_distance('a4a65595ac94518b', '7838873e791f8400')
707708

708709
## Sample Application
709710
There are three sample apps:
711+
710712
* Rails application using Carrierwave
711713
* Rails application using ActiveStorage
712714
* Plain ruby application
@@ -715,7 +717,7 @@ Please see the sample applications in [here](https://github.com/imagekit-samples
715717

716718
## Upgrade to 2.0.0
717719

718-
Application using variants of version 1.0 needs following changes in order to use version 2.0.0:
720+
If you are upgrading to 2.0.0 from version 1.x, make the following changes in your application:
719721

720722
- Remove config from environment file to initializer file as described [here](#Initialization).
721723
- Include `ImageKitIo::CarrierWave` in uploader class(for Carrierwave).

0 commit comments

Comments
 (0)