Created
November 8, 2011 17:42
-
-
Save firebelly/1348496 to your computer and use it in GitHub Desktop.
save the damn thumbs
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
# load an image from an external URL, create a crop, and save it to disk | |
# *run from rails console of an app with Dragonfly already initialized at startup | |
app = Dragonfly[:images] | |
image = app.fetch_url('http://farm6.static.flickr.com/5277/5890615224_2fb702c22c_b.jpg') | |
image.process('412x252#').to_file("#{Rails.root}/public/system/images/#{url.split('/').last}") | |
`open /Users/brandon/webapps/fchapp/public/system/images/5890615224_2fb702c22c_b.jpg` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment