Skip to content

Instantly share code, notes, and snippets.

@agius
Created January 29, 2013 16:12
Show Gist options
  • Save agius/4665418 to your computer and use it in GitHub Desktop.
Save agius/4665418 to your computer and use it in GitHub Desktop.
Parsing base64 encoded images
if params['format'] == 'base64' || params[:image].is_a?(String)
img = Magick::Image.read_inline(params[:image])
fn = params['filename']
else
img = img = Magick::Image.from_blob(params[:image][:tempfile].read)
fn = params[:image][:filename]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment