Cloudinary is one of services providing useful image-based API and CDN. In this article, I would like to introduce Ruby the sample code to resize a image by using the service.
🚌 Installation
Install RubyGem cloudinary. Please add the following RubyGem name and execute bundle install
in terminal.
gem 'cloudinary' |
🏈 Ge API Key
Free member registration from https://cloudinary.com/ and you can get your API key.
🎂 Sample code for resizing image
You can get resized image by the following code:
require 'faraday' |
🎃 References
- https://www.rubydoc.info/github/cloudinary/cloudinary_gem/index
- https://cloudinary.com/documentation/image_transformations
- https://cloudinary.com/documentation/image_transformation_reference
🖥 Recommended VPS Service
VULTR provides high performance cloud compute environment for you.
Vultr has 15 data-centers strategically placed around the globe, you can use a VPS with 512 MB memory for just $ 2.5 / month ($ 0.004 / hour).
In addition, Vultr is up to 4 times faster than the competition, so please check it => Check Benchmark Results!!