Class: WallScaler
Instance Method Summary collapse
Methods included from WallOperations
#get_scaled_size, #place_onto, #place_through, #prepare_backdrop, #prepare_image, #save_image
Instance Method Details
#scale(image, options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/wall_scaler.rb', line 9 def scale(image, = {}) width = ['width'] || 1920 height = ['height'] || 1200 color = ['color'] || 'black' title = ['title'] || "#{File.basename(image, ".jpg")} scaled.jpg" im = prepare_image(image, width, height) result = prepare_backdrop({'width' => width, 'height' => height, 'color' => color}) place_through(0, 0, width, height, im, result) save_image(result, title) end |