Last active
January 3, 2016 04:59
-
-
Save TonsOfFun/8412642 to your computer and use it in GitHub Desktop.
mini_magick to reduce filesize while retaining maximum quality
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
original_file_path = '' | |
new_file_path = '' | |
original_file = MiniMagick::Image.open(original_file_path) | |
og = original_file | |
og.combine_options do |ops| | |
ops.quality "85" | |
ops.interlace "Plane" | |
ops.strip | |
ops.gravity "Center" | |
ops.resize "640x640^" | |
ops.crop "640x640+0+0" | |
end | |
og.write new_file_path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment