<分区>
Possible Duplicate:
How to convert an image object to a binary blob
我在加载远程图像时面临同源策略限制。然而,DOM 0 Image 对象可用于加载远程资源(这与创建 <img />
标签本质上相同)。
var fr = new FileReader(),
img = new Image();
img.src = 'http://distilleryimage8.s3.amazonaws.com/6cf25568491a11e2af8422000a9e28e9_7.jpg';
img.onload = function () {
// how to get this image as a Blob object?
};
有没有办法将此资源读入 Blob/arraybuffer 对象?这不是 How to convert an image object to a binary blob 的副本因为后者不会随着同源问题而上升。