title: Convert images from base64 to PNG intermittent error
body: <p>I have an application that produces an image using HTML5 canvas. When the user wants to save the results, it flattens all the canvas layers into a new canvas and sends the string to be processed by Coldfusion into a PNG file. </p>
  
  <p>The problem I'm having is that sometimes I get a Coldfusion error:</p>
  
  <p>"Verify your inputs. The Base64 data is not in proper format. Data should be in the format understood by the  tag in HTML, which is "data:image/jpg;base64,[base64 data]"</p>
  
  <p>This happens only maybe 3% of the time. When I try to reproduce it using the exact same selections, it works fine. </p>
  
  <p>This is the code that I'm using</p>
  
  <pre><code>&lt;cfset image = imageReadBase64("#form.image#")&gt;
  &lt;cfset fileName = #RandString(40)# &amp; '.png'&gt;
  
  &lt;cfimage 
      source="#image#" 
      destination="C:\something\#fileName#" 
      action="write"
      overwrite = "yes"&gt;
  </code></pre>
  
  <p>Thank you</p>