function imgSrcToDataURL(src, type, crossOrigin, quality) {
        type = type || 'image/png';
        return loadImage(src, crossOrigin).then(imgToCanvas).then(function (canvas) {
            return canvas.toDataURL(type, quality);
        });
    }
Convert an image's <code>src</code> URL to a data URL by loading the image and painting
it to a <code>canvas</code>.

Note: this will coerce the image to the desired content type, and it
will only paint the first frame of an animated GIF.

Examples:

```js
blobUtil.imgSrcToDataURL('http://mysite.com/img.png').then(function (dataURL) {
  // success
}).catch(function (err) {
  // error
});
```

```js
blobUtil.imgSrcToDataURL('http://some-other-site.com/img.jpg', 'image/jpeg',
                         'Anonymous', 1.0).then(function (dataURL) {
  // success
}).catch(function (err) {
  // error
});
```

@param src - image src
@param type - the content type (optional, defaults to 'image/png')
@param crossOrigin - for CORS-enabled images, set this to
                                        'Anonymous' to avoid "tainted canvas" errors
@param quality - a number between 0 and 1 indicating image quality
                                    if the requested type is 'image/jpeg' or 'image/webp'
@returns Promise that resolves with the data URL string