Last active
December 17, 2015 21:19
-
-
Save sled/95dbaec1834f533eb172 to your computer and use it in GitHub Desktop.
Revisions
-
sled revised this gist
Dec 17, 2015 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,11 @@ Refile::MiniMagick.prepend Module.new { define_method('rotate') do |img, angle=0| img.combine_options do |cmd| yield cmd if block_given? cmd.rotate angle end end define_method('fill_rotate') do |img, width, height, angle=0, gravity="Center"| # We use `convert` to work around GraphicsMagick's absence of "gravity" ::MiniMagick::Tool::Convert.new do |cmd| -
sled created this gist
Dec 17, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ Refile::MiniMagick.prepend Module.new { define_method('fill_rotate') do |img, width, height, angle=0, gravity="Center"| # We use `convert` to work around GraphicsMagick's absence of "gravity" ::MiniMagick::Tool::Convert.new do |cmd| yield cmd if block_given? cmd.rotate angle cmd.resize "#{width}x#{height}^" cmd.gravity gravity cmd.extent "#{width}x#{height}" cmd.merge! [img.path, img.path] end end }