Created
January 26, 2011 20:40
-
-
Save softwaregravy/797407 to your computer and use it in GitHub Desktop.
Getting an image into Base64
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 characters
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 characters
| http_client = HTTPClient.new | |
| image = http_client.get_content 'https://s3.amazonaws.com/relusions/ads/restaurant/rectangle_restaurant3-30.jpg' | |
| base64_image = Base64.encode64 image |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment