Javascript cropper.js无法通过blueimp初始化blob图像标记
所以我想要的是: 选择具有输入类型文件的图像, 缩小规模, 将该图像裁剪为 因此blueimp部分工作正常,图像大小调整为maxWidth属性,并作为标记附加到imagearea,然后我想基于该标记初始化crapper.js,就像在文档中一样,下面是我的代码Javascript cropper.js无法通过blueimp初始化blob图像标记,javascript,jquery,blueimp,cropper,Javascript,Jquery,Blueimp,Cropper,所以我想要的是: 选择具有输入类型文件的图像, 缩小规模, 将该图像裁剪为 因此blueimp部分工作正常,图像大小调整为maxWidth属性,并作为标记附加到imagearea,然后我想基于该标记初始化crapper.js,就像在文档中一样,下面是我的代码 document.getElementById('file-input').onchange = function (e) { var loadingImage = loadImage( e.target
document.getElementById('file-input').onchange = function (e) {
var loadingImage = loadImage(
e.target.files[0],
function (img) {
$(img).attr("style","max-width: 100%;")
$('#imagearea').append(img)
// now i see the image and when i inspect dom its a <img> tag
// so lets initialize the cropper
$('#imagearea').find("img").cropper({
aspectRatio: 16 / 9,
crop: function(e) {
}
});
},
{maxWidth: 1280}
);
};
然后
未捕获范围错误:偏移量超出DataView的界限
在DataView.getUint8
在m6eaf333.js:7051
在e.value 6eaf333.js:7051处
在XMLHttpRequest.n.onload 6eaf333.js:7051上,请使用noRevoke选项 document.getElementById'file-input'.onchange=函数e{ var loadingImage=loadImage e、 target.files[0], 函数img{ $img.attrstyle,最大宽度:100%; $'imagearea'。附录 //现在我看到了图像,当我检查dom时,它是一个标记 //因此,让我们初始化裁剪器 $'imagearea'.findimg.crapper{ 专题:16/9, 作物:功能{ } }; }, {maxWidth:1280,noRevoke:true} ; };
GET blob:http://foo.bar/64c77709-29f7-44ba-8772-49517e7976e5 404 (Not Found)