In this article, I would like to show a sample code to generate square thumbnail image by using Minimagick
which is a Ruby wrapper for ImageMagic.
Add the gem to your Gemfile & run
In a sample source, I will show you following flow:
- (1) Download Sample Image
- (2) Cut out a square thumbnail image by using Minimagick
- (3) Save Image to file
So, it is operation confirmation.
The above image(640x480) was converted to the following square image(300x300):
🖥 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!!