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
ImageKit gem for Ruby on Rails that allows you to use real-time [image resizing](https://docs.imagekit.io/features/image-transformations), [optimization](https://docs.imagekit.io/features/image-optimization), and [file uploading](https://docs.imagekit.io/api-reference/upload-file-api/).
11
+
Ruby on Rails gem for [ImageKit](https://imagekit.io/) implements the new APIs and interface for different file operations.
12
+
13
+
ImageKit is complete media storage, optimization, and transformation solution that comes with an [image and video CDN](https://imagekit.io/features/imagekit-infrastructure). It can be integrated with your existing infrastructure - storage like AWS S3, web servers, your CDN, and custom domain names, allowing you to deliver optimized images in minutes with minimal code changes.
12
14
13
15
Table of contents -
14
16
*[Installation](#Installation)
@@ -155,20 +157,17 @@ imagekitio:
155
157
156
158
## Usage
157
159
158
-
You can use this Ruby SDK for three different methods - URL generation, file upload, and file management.
160
+
You can use this Ruby SDK for three different methods - URL generation, file upload, and media management operations. The usage of the SDK has been explained below.
159
161
160
-
The usage of the SDK has been explained below.
162
+
*`URL Generation`
163
+
*`File Upload`
164
+
*`File Management`
161
165
162
166
## URL generation
163
167
164
168
**1. Using Image path and image hostname or endpoint**
165
169
166
-
This method allows you to create a URL using the path where the image exists and the URL
167
-
endpoint(url_endpoint) you want to use to access the image. You can refer to the documentation
168
-
[here](https://docs.imagekit.io/integration/url-endpoints) to read more about URL endpoints
169
-
in ImageKit and the section about [image origins](https://docs.imagekit.io/integration/configure-origin) to understand
170
-
about paths with different kinds of origins.
171
-
170
+
This method allows you to create an URL to access a file using the relative file path and the ImageKit URL endpoint (`urlEndpoint`). The file can be an image, video or any other static file supported by ImageKit.
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
189
-
database.
187
+
This method allows you to add transformation parameters to an absolute URL. For example, if you have configured a custom CNAME and have absolute asset URLs in your database or CMS, you will often need this.
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).
290
-
The SDK gives a name to each transformation parameter, making the code simpler, making the code simpler, and readable.
287
+
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). The SDK gives a name to each transformation parameter, making the code simpler, making the code simpler, and readable.
291
288
292
289
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
290
@@ -385,7 +382,7 @@ be `None`.
385
382
The SDK provides a simple interface for all the [media APIs mentioned here](https://docs.imagekit.io/api-reference/media-api)
386
383
to manage your files. This also returns `error` and `result`. The `error` will be `None` if API succeeds.
387
384
388
-
**1. List & Search Files**
385
+
**List & Search Files**
389
386
390
387
Accepts an object specifying the parameters to be used to list and search files. All parameters specified
391
388
in the [documentation here](https://docs.imagekit.io/api-reference/media-api/list-and-search-files#list-and-search-file-api) can be passed with the
@@ -397,7 +394,7 @@ imagekitio.list_files(
397
394
limit:5
398
395
)
399
396
```
400
-
**2. Get File Details**
397
+
**Get File Details**
401
398
Accepts the file ID and fetches the details as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/get-file-details)
Accepts the file ID and fetches the metadata as per the [API documentation here](https://docs.imagekit.io/api-reference/metadata-api/get-image-metadata-for-uploaded-media-files)
411
408
```ruby
412
409
imagekit.get_file_metadata(
413
410
file_id:'598821f949c0a938d57563bd'
414
411
)
415
412
```
416
413
417
-
**3. Get File Metadata from remote url**
414
+
**Get File Metadata from remote url**
418
415
Accepts the remote file url and fetches the metadata as per the [API documentation here](https://docs.imagekit.io/api-reference/metadata-api/get-image-metadata-from-remote-url)
Copy file from one path to another path using the source file path and the destination path as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/copy-file)
442
439
@@ -448,7 +445,7 @@ imagekitio.copy_file(
448
445
)
449
446
```
450
447
451
-
**6. Move File**
448
+
**Move File**
452
449
453
450
Move file from one folder to another folder using the source file path and destination path as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/move-file)
454
451
@@ -459,7 +456,7 @@ imagekitio.move_file(
459
456
)
460
457
```
461
458
462
-
**7. Rename File**
459
+
**Rename File**
463
460
464
461
Rename file as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/rename-file)
465
462
@@ -471,7 +468,7 @@ imagekitio.rename_file(
471
468
)
472
469
```
473
470
474
-
**8. Delete File**
471
+
**Delete File**
475
472
476
473
Delete a file as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/delete-file). The method accepts the file ID of the file that has to be deleted.
477
474
@@ -480,7 +477,7 @@ imagekitio.delete_file(
480
477
file_id:'598821f949c0a938d57563bd'
481
478
)
482
479
```
483
-
**9. File versions**
480
+
**File versions**
484
481
485
482
Get all file versions as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/get-file-versions). The method accepts the file ID of the file.
486
483
@@ -489,7 +486,7 @@ imagekitio.file_versions(
489
486
file_id:'598821f949c0a938d57563bd'
490
487
)
491
488
```
492
-
**10. File version details**
489
+
**File version details**
493
490
494
491
Get all file version detail as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/get-file-version-details). The method accepts the file ID and version ID of the file.
Delete file version as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/delete-file-version). The method accepts the file ID and version ID of the file.
Restore deleted file version as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/restore-file-version). The method accepts the file ID and version ID of the file.
Delete a file as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/delete-files-bulk). The method accepts a list of file IDs of files that has to be
528
525
deleted.
@@ -533,7 +530,7 @@ imagekitio.delete_bulk_files(
533
530
)
534
531
```
535
532
536
-
**14. Purge Cache**
533
+
**Purge Cache**
537
534
Programmatically issue a clear cache request as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/purge-cache).
538
535
Accepts the full URL of the file for which the cache has to be cleared.
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)
559
556
@@ -564,7 +561,7 @@ imagekitio.add_bulk_tags(
564
561
)
565
562
```
566
563
567
-
**17. Delete Bulk Tags**
564
+
**Delete Bulk Tags**
568
565
569
566
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)
570
567
@@ -575,7 +572,7 @@ imagekitio.delete_bulk_tags(
575
572
)
576
573
```
577
574
578
-
**18. Delete Bulk Ai Tags**
575
+
**Delete Bulk AI Tags**
579
576
580
577
Delete bulk ai tags as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/remove-aitags-bulk)
Create folder as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/create-folder)
592
589
@@ -598,7 +595,7 @@ imagekitio.create_folder(
598
595
```
599
596
600
597
601
-
**20. Copy Folder**
598
+
**Copy Folder**
602
599
603
600
Copy folder as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/copy-folder)
604
601
@@ -610,7 +607,7 @@ imagekitio.copy_folder(
610
607
)
611
608
```
612
609
613
-
**21. Move Folder**
610
+
**Move Folder**
614
611
615
612
Move folder as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/move-folder)
616
613
@@ -621,7 +618,7 @@ imagekitio.move_folder(
621
618
)
622
619
```
623
620
624
-
**22. Delete Folder**
621
+
**Delete Folder**
625
622
626
623
Delete folder as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/delete-folder)
627
624
@@ -631,7 +628,7 @@ imagekitio.delete_folder(
631
628
)
632
629
```
633
630
634
-
**23. Bulk Job Status**
631
+
**Bulk Job Status**
635
632
636
633
Get the bulk job status as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/copy-move-folder-status)
637
634
@@ -641,7 +638,7 @@ imagekitio.bulk_job_status(
641
638
)
642
639
```
643
640
644
-
**24. Create Custom Metadata Fields**
641
+
**Create a custom metadata field**
645
642
646
643
Create custom metadata fields as per the [API documentation here](https://docs.imagekit.io/api-reference/custom-metadata-fields-api/create-custom-metadata-field)
Get the custom metadata fields as per the [API documentation here](https://docs.imagekit.io/api-reference/custom-metadata-fields-api/get-custom-metadata-field)
Update custom metadata fields as per the [API documentation here](https://docs.imagekit.io/api-reference/custom-metadata-fields-api/update-custom-metadata-field)
Delete custom metadata fields as per the [API documentation here](https://docs.imagekit.io/api-reference/custom-metadata-fields-api/delete-custom-metadata-field)
0 commit comments