Created
December 30, 2018 17:54
-
-
Save Yegorov/2f4254932122bb6e1e6aa685a55eebc0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "mini_magick" | |
in_name = "in.jpg" | |
out_name = "out.jpg" | |
image = MiniMagick::Image.open(in_name) | |
image.combine_options do |im| | |
im.extent image.dimensions.max | |
im.gravity "Center" | |
end | |
image.write(out_name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment