|
@@ -223,11 +223,21 @@ this.docHelper = this.docHelper || (() => {
|
|
|
imageElement = element;
|
|
imageElement = element;
|
|
|
}
|
|
}
|
|
|
if (imageElement) {
|
|
if (imageElement) {
|
|
|
|
|
+ let naturalWidth = imageElement.naturalWidth;
|
|
|
|
|
+ let naturalHeight = imageElement.naturalHeight;
|
|
|
|
|
+ if (naturalWidth <= 1 && naturalHeight <= 1) {
|
|
|
|
|
+ const imgElement = doc.createElement("img");
|
|
|
|
|
+ imgElement.src = imageElement.src;
|
|
|
|
|
+ doc.body.appendChild(imgElement);
|
|
|
|
|
+ naturalWidth = imgElement.width;
|
|
|
|
|
+ naturalHeight = imgElement.height;
|
|
|
|
|
+ imgElement.remove();
|
|
|
|
|
+ }
|
|
|
imageData.source = {
|
|
imageData.source = {
|
|
|
clientWidth: imageElement.clientWidth,
|
|
clientWidth: imageElement.clientWidth,
|
|
|
clientHeight: imageElement.clientHeight,
|
|
clientHeight: imageElement.clientHeight,
|
|
|
- naturalWidth: imageElement.naturalWidth,
|
|
|
|
|
- naturalHeight: imageElement.naturalHeight,
|
|
|
|
|
|
|
+ naturalWidth: naturalWidth,
|
|
|
|
|
+ naturalHeight: naturalHeight,
|
|
|
width: imageElement.width,
|
|
width: imageElement.width,
|
|
|
height: imageElement.height,
|
|
height: imageElement.height,
|
|
|
src: (!imageElement.currentSrc.startsWith("data:") && imageElement.currentSrc) || (!imageElement.src.startsWith("data:") && imageElement.src)
|
|
src: (!imageElement.currentSrc.startsWith("data:") && imageElement.currentSrc) || (!imageElement.src.startsWith("data:") && imageElement.src)
|