Skip to content

Commit

Permalink
fix(img-utils): Fix the image loading error
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerwin-L committed Mar 8, 2023
1 parent 6aa9606 commit 0bbd8dd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/lb-annotation/src/utils/ImgUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ export default class ImgUtils {
return new Promise<HTMLImageElement>((resolve, reject) => {
const imgNode = new Image();

imgNode.crossOrigin = 'anonymous';

// 暂时判断 file 协议的路径进行 encode 操作
if (src.startsWith('file')) {
imgNode.src = encodeURI(src);
Expand Down

0 comments on commit 0bbd8dd

Please sign in to comment.