简体   繁体   English

为什么 Crowd HTML 会破坏此图像?

[英]Why is Crowd HTML breaking this image?

I'm using Crowd HTML Elements to perform bounding box annotation, but when I attempt to load some of my images, I get this error in the dev tools console:我正在使用 Crowd HTML Elements 来执行边界框注释,但是当我尝试加载一些图像时,我在开发工具控制台中收到此错误:

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

The Unexpected image dimensions during normalization portion seems like the issue, but I've found nothing with regard to troubleshooting.标准化部分期间意外的图像尺寸似乎是问题所在,但我没有发现任何有关故障排除的信息。 Can someone explain what expected image dimensions are and why some are failing?有人可以解释什么是预期的图像尺寸以及为什么有些失败?

Here's a snippet of the code that's throwing the error.这是引发错误的代码片段。

            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")

Thanks!谢谢!

结果证明该问题与应用于我网站的画布部分的 css 样式有关,该部分正在加载标签工具。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM