title: Open and save base64 encoded image data URI in Ruby
body: <p>From several posts I've seen, I am trying this</p>
  
  <pre><code>x = Base64.decode64("data:image/png;base64,iVBOR....")
  File.open('test.png','wb') {|file| file.write x}
  </code></pre>
  
  <p>But then I can't open the image with a viewer, do I have to do something more?</p>