首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么人群HTML破坏了这个图像?

为什么人群HTML破坏了这个图像?
EN

Stack Overflow用户
提问于 2020-10-05 20:49:01
回答 1查看 170关注 0票数 1

我使用人群HTML元素来执行边界框注释,但是当我试图加载一些图像时,我在dev工具控制台中得到了这个错误:

代码语言:javascript
复制
crowd-html-elements.js:1 window.onError received an event without an error:  {event: ErrorEvent}
(anonymous) @ crowd-html-elements.js:1
error (async)
e @ crowd-html-elements.js:1
e @ crowd-html-elements.js:1
./src/crowd-html-elements-loader.ts @ crowd-html-elements.js:1
s @ crowd-html-elements.js:1
(anonymous) @ crowd-html-elements.js:1
(anonymous) @ crowd-html-elements.js:1
crowd-html-elements-without-ce-polyfill.js:6282 window.onError received an event without an error:  {event: ErrorEvent}
(anonymous) @ crowd-html-elements-without-ce-polyfill.js:6282
error (async)
e @ crowd-html-elements-without-ce-polyfill.js:6282
e @ crowd-html-elements-without-ce-polyfill.js:6282
./src/index.ts @ crowd-html-elements-without-ce-polyfill.js:6282
r @ crowd-html-elements-without-ce-polyfill.js:1
(anonymous) @ crowd-html-elements-without-ce-polyfill.js:1
(anonymous) @ crowd-html-elements-without-ce-polyfill.js:1
crowd-html-elements-without-ce-polyfill.js:6282 Uncaught Error: Unexpected image dimensions during normalization
    at Function.normalizeHeight (crowd-html-elements-without-ce-polyfill.js:6282)
    at Function.normalizeDimensions (crowd-html-elements-without-ce-polyfill.js:6282)
    at new a (crowd-html-elements-without-ce-polyfill.js:6282)
    at ie.handleTargetImageLoaded (crowd-html-elements-without-ce-polyfill.js:6282)
    at Image.r.onload (crowd-html-elements-without-ce-polyfill.js:6282)
normalizeHeight @ crowd-html-elements-without-ce-polyfill.js:6282
normalizeDimensions @ crowd-html-elements-without-ce-polyfill.js:6282
a @ crowd-html-elements-without-ce-polyfill.js:6282
handleTargetImageLoaded @ crowd-html-elements-without-ce-polyfill.js:6282
r.onload @ crowd-html-elements-without-ce-polyfill.js:6282
load (async)
setBackgroundImage @ crowd-html-elements-without-ce-polyfill.js:6282
renderImageSrcChange @ crowd-html-elements-without-ce-polyfill.js:6282
shouldComponentUpdate @ crowd-html-elements-without-ce-polyfill.js:6282
q @ crowd-html-elements-without-ce-polyfill.js:6278
B @ crowd-html-elements-without-ce-polyfill.js:6278
q @ crowd-html-elements-without-ce-polyfill.js:6278
B @ crowd-html-elements-without-ce-polyfill.js:6278
F @ crowd-html-elements-without-ce-polyfill.js:6278
N @ crowd-html-elements-without-ce-polyfill.js:6278
E @ crowd-html-elements-without-ce-polyfill.js:6278
N @ crowd-html-elements-without-ce-polyfill.js:6278
E @ crowd-html-elements-without-ce-polyfill.js:6278
N @ crowd-html-elements-without-ce-polyfill.js:6278
E @ crowd-html-elements-without-ce-polyfill.js:6278
N @ crowd-html-elements-without-ce-polyfill.js:6278
T @ crowd-html-elements-without-ce-polyfill.js:6278
q @ crowd-html-elements-without-ce-polyfill.js:6278
B @ crowd-html-elements-without-ce-polyfill.js:6278
F @ crowd-html-elements-without-ce-polyfill.js:6278
N @ crowd-html-elements-without-ce-polyfill.js:6278
T @ crowd-html-elements-without-ce-polyfill.js:6278
G @ crowd-html-elements-without-ce-polyfill.js:6278
w @ crowd-html-elements-without-ce-polyfill.js:6278
S @ crowd-html-elements-without-ce-polyfill.js:6278
e.reactMount @ crowd-html-elements-without-ce-polyfill.js:3
e.updateRegion @ crowd-html-elements-without-ce-polyfill.js:3
(anonymous) @ crowd-html-elements-without-ce-polyfill.js:3
(anonymous) @ crowd-html-elements-without-ce-polyfill.js:3
(anonymous) @ crowd-html-elements-without-ce-polyfill.js:3
e.reactBatchUpdate @ crowd-html-elements-without-ce-polyfill.js:3
i @ crowd-html-elements-without-ce-polyfill.js:3
f.componentDidUpdate @ crowd-html-elements-without-ce-polyfill.js:3
q @ crowd-html-elements-without-ce-polyfill.js:6278
B @ crowd-html-elements-without-ce-polyfill.js:6278
F @ crowd-html-elements-without-ce-polyfill.js:6278
N @ crowd-html-elements-without-ce-polyfill.js:6278
E @ crowd-html-elements-without-ce-polyfill.js:6278
N @ crowd-html-elements-without-ce-polyfill.js:6278
E @ crowd-html-elements-without-ce-polyfill.js:6278
N @ crowd-html-elements-without-ce-polyfill.js:6278
T @ crowd-html-elements-without-ce-polyfill.js:6278
q @ crowd-html-elements-without-ce-polyfill.js:6278
B @ crowd-html-elements-without-ce-polyfill.js:6278
q @ crowd-html-elements-without-ce-polyfill.js:6278
B @ crowd-html-elements-without-ce-polyfill.js:6278
q @ crowd-html-elements-without-ce-polyfill.js:6278
B @ crowd-html-elements-without-ce-polyfill.js:6278
q @ crowd-html-elements-without-ce-polyfill.js:6278
B @ crowd-html-elements-without-ce-polyfill.js:6278
F @ crowd-html-elements-without-ce-polyfill.js:6278
N @ crowd-html-elements-without-ce-polyfill.js:6278
E @ crowd-html-elements-without-ce-polyfill.js:6278
N @ crowd-html-elements-without-ce-polyfill.js:6278
T @ crowd-html-elements-without-ce-polyfill.js:6278
G @ crowd-html-elements-without-ce-polyfill.js:6278
w @ crowd-html-elements-without-ce-polyfill.js:6278
_renderReactComponent @ crowd-html-elements-without-ce-polyfill.js:6282
_updateReactComponent @ crowd-html-elements-without-ce-polyfill.js:6282
Y @ crowd-html-elements-without-ce-polyfill.js:5984
C @ crowd-html-elements-without-ce-polyfill.js:5984
k @ crowd-html-elements-without-ce-polyfill.js:5984
_propertiesChanged @ crowd-html-elements-without-ce-polyfill.js:5984
_flushProperties @ crowd-html-elements-without-ce-polyfill.js:5954
_flushProperties @ crowd-html-elements-without-ce-polyfill.js:5984
_invalidateProperties @ crowd-html-elements-without-ce-polyfill.js:5984
_setProperty @ crowd-html-elements-without-ce-polyfill.js:5984
Object.defineProperty.set @ crowd-html-elements-without-ce-polyfill.js:5954
(anonymous) @ labeling.html:199
async function (async)
(anonymous) @ labeling.html:198
Promise.then (async)
(anonymous) @ labeling.html:196

在规范化部分中意外的图像维度似乎是个问题,但我在故障排除方面没有发现任何问题。有人能解释什么是预期的图像维数和为什么有些失败?

下面是抛出错误的代码片段。

代码语言:javascript
复制
            static normalizeHeight(e) {
                if (e.height === e.naturalHeight)
                    return e.height;
                if (e.height === e.naturalWidth)
                    return e.height;
                if (Math.abs(e.height - e.naturalHeight) < 2)
                    return e.naturalHeight;
                if (Math.abs(e.height - e.naturalWidth) < 2)
                    return e.naturalWidth;
                throw new Error("Unexpected image dimensions during normalization")
            }
            static normalizeWidth(e) {
                if (e.width === e.naturalWidth)
                    return e.width;
                if (e.width === e.naturalHeight)
                    return e.width;
                if (Math.abs(e.width - e.naturalWidth) < 2)
                    return e.naturalWidth;
                if (Math.abs(e.width - e.naturalHeight) < 2)
                    return e.naturalHeight;
                throw new Error("Unexpected image dimensions during normalization")

谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-10-22 11:51:57

这个问题被证明是与css样式有关的,它被应用到我的站点的画布部分,它正在加载标签工具。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64215998

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档