title: How to get file size of newly created Image() if src is base64 string?
body: <p>How can I get the size of the newly created <code>new Image()</code> in bytes if this image's <code>src</code> is <code>base64</code> data image?</p>
  
  <p>I have such coffeescript code:</p>
  
  <pre><code># This string is received after some original image preprocessing
  base64String = "data:image/jpeg;base64......"
  
  newImageObj = new Image()
  newImageObj.src = base64String
  newImageObj.onload = -&gt;
    console.log "Resized image width is " + this.width
    console.log "New file size in bytes is " + newImageObj.fileSize
  </code></pre>
  
  <p>The output is always like this:</p>
  
  <pre><code>Resized image width is 500
  New file size in bytes is undefined
  </code></pre>
  
  <p>This <code>newImageObj.fileSize</code> is always <code>undefined</code>.</p>