Created
August 29, 2012 16:51
-
-
Save matthewkcarr/3515551 to your computer and use it in GitHub Desktop.
using mini magick to add padding of white centered around an image
This file contains 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
image = MiniMagick::Image.open('./ex-image.jpg') | |
image.combine_options(:convert) do |c| | |
c.extent('600x') | |
c.gravity('center') | |
c.background('white') | |
end | |
image.write('shaweet.jpg') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment