|
|
@@ -164,7 +164,6 @@ this.docHelper = this.docHelper || (() => {
|
|
|
if (imageElement.src) {
|
|
|
let naturalWidth = imageElement.naturalWidth;
|
|
|
let naturalHeight = imageElement.naturalHeight;
|
|
|
- let preserveAspectRatio = false;
|
|
|
if (naturalWidth <= 1 && naturalHeight <= 1) {
|
|
|
const imgElement = doc.createElement("img");
|
|
|
imgElement.src = imageElement.src;
|
|
|
@@ -172,9 +171,6 @@ this.docHelper = this.docHelper || (() => {
|
|
|
naturalWidth = imgElement.width;
|
|
|
naturalHeight = imgElement.height;
|
|
|
imgElement.remove();
|
|
|
- if (naturalWidth > 1 && naturalHeight > 1) {
|
|
|
- preserveAspectRatio = true;
|
|
|
- }
|
|
|
}
|
|
|
imageData = {
|
|
|
width: imageElement.width,
|
|
|
@@ -182,8 +178,7 @@ this.docHelper = this.docHelper || (() => {
|
|
|
clientWidth: imageElement.clientWidth,
|
|
|
clientHeight: imageElement.clientHeight,
|
|
|
naturalWidth,
|
|
|
- naturalHeight,
|
|
|
- preserveAspectRatio
|
|
|
+ naturalHeight
|
|
|
};
|
|
|
}
|
|
|
data.push(imageData);
|