Method: QuickFile.resize_to_fit
- Defined in:
- lib/quick_file.rb
.resize_to_fit(file, x, y) ⇒ Object
60 61 62 63 64 65 66 |
# File 'lib/quick_file.rb', line 60 def resize_to_fit(file, x, y) img = Magick::Image.read(file).first nim = img.resize_to_fit x, y outfile = cache_path(generate_cache_name(File.extname(file))) nim.write outfile outfile end |