Cordova camera take picture as Blob object
<p>I'm trying to take a picture using <code>cordova-plugin-camera</code>. I'd like the result to be a <code>File</code> or <code>Blob</code> object.</p>

<p>However, the <a href="https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-camera/index.html#module_Camera.DestinationType" rel="noreferrer"><code>destinationType</code></a> must be one of <code>DATA_URL</code> or <code>FILE_URI</code>.</p>

<p>The docs state:</p>

<blockquote>
  <p>DATAURL can be very memory intensive and cause app crashes or out of memory errors. Use FILEURI or NATIVE_URI if possible</p>
</blockquote>

<p>However, as far as I can tell, converting such a file uri to a Blob takes these steps:</p>

<ol>
<li>Rendering the uri on a <code>&lt;img/</code></li>
<li>Draw image on a canvas</li>
<li>Read canvas as base64</li>
<li>Convert base64 to <code>Blob</code></li>
</ol>

<p>I find it hard to believe that this is more efficient than using <code>DATAURL</code>. So I might just as well use <code>DATAURL</code> for this and skip steps 1-3.</p>

<p>Is there a way to just get a picture taken as a <code>Blob</code> object in a more efficient way?</p>