Module: Image
- Defined in:
- lib/image.rb
Overview
Build browserconfig XML
Class Method Summary collapse
- .basic_options(convert, options) ⇒ Object
- .convert(source, output, options = {}) ⇒ Object
- .odd_options(convert, options) ⇒ Object
- .options_for(convert, options) ⇒ Object
- .resize_options(convert, options) ⇒ Object
Class Method Details
.basic_options(convert, options) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/image.rb', line 18 def self.(convert, ) convert.background [:background] if [:background] convert.define [:define] if [:define] convert.density [:density] if [:density] convert.alpha [:alpha] if [:alpha] end |
.convert(source, output, options = {}) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/image.rb', line 3 def self.convert(source, output, = {}) MiniMagick::Tool::Convert.new do |convert| convert, convert << source convert << output end end |
.odd_options(convert, options) ⇒ Object
29 30 31 32 |
# File 'lib/image.rb', line 29 def self.(convert, ) convert.gravity 'center' if [:odd] convert.extent [:resize] if [:odd] && [:resize] end |
.options_for(convert, options) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/image.rb', line 11 def self.(convert, ) convert.flatten convert, convert, convert, end |
.resize_options(convert, options) ⇒ Object
25 26 27 |
# File 'lib/image.rb', line 25 def self.(convert, ) convert.resize [:resize] if [:resize] end |