Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

图片太大情况下,图片加载不出来 #191

Open
kaikaiwei opened this issue Jun 3, 2020 · 0 comments
Open

图片太大情况下,图片加载不出来 #191

kaikaiwei opened this issue Jun 3, 2020 · 0 comments

Comments

@kaikaiwei
Copy link

chrome浏览器,图片大小5M,需要旋转的jpeg格式。
问题:首次无法打开,无法进行显示。
原因:canvas.drawImage方法调用的时候,图片还没有准备好。
代码: ng-image-crop.js 1593行。
这里调用canvas.toDataURL("image/png")的时候,图片没有准备好。
修改方式:
var tmp = new Image();
tmp.src = canvas.toDataURL("image/png");
tmp.onload = function() {
image = tmp;
setTimeout(function () {
resetCropHost();
events.trigger('image-updated');
}, 20 )
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant