祖安之光
2025-12-03 52bd5557cb7a3eeb467f75a2b9101bf7f097754f
src/views/build/conpanyFunctionConsult/digitalFileDep/manageType/qualityManual/components/exportDoc.js
@@ -287,13 +287,13 @@
        return parseImageDimensions(bytes);
    } catch (error) {
        console.warn('解析图片尺寸失败:', error);
        return { width: 600, height: 400 };
        return { width: 550, height: 400 };
    }
}
function parseImageDimensions(bytes) {
    if (bytes.length < 8) {
        return { width: 600, height: 400 };
        return { width: 550, height: 400 };
    }
    // 检查 PNG 格式 (89 50 4E 47 0D 0A 1A 0A)
@@ -307,7 +307,7 @@
        return parseJPEGDimensions(bytes);
    }
    return { width: 600, height: 400 };
    return { width: 550, height: 400 };
}
// 解析 PNG 尺寸
@@ -319,7 +319,7 @@
        const height = view.getUint32(20, false);
        return { width, height };
    }
    return { width: 600, height: 400 };
    return { width: 550, height: 400 };
}
// 解析 JPEG 尺寸
@@ -353,7 +353,7 @@
        }
    }
    return { width: 600, height: 400 };
    return { width: 550, height: 400 };
}
const imageOptions = {
@@ -363,10 +363,10 @@
    getSize(img, tagValue, tagName, context) {
        const dimensions = getDimensionsFromBase64Sync(tagValue);
        const { width, height } = dimensions;
        const targetWidth = 600;
        const targetWidth = 550;
        const scale = targetWidth / width;
        let targetHeight = height * scale;
        targetHeight = Math.max(100, Math.min(700, targetHeight));
        targetHeight = Math.max(100, Math.min(800, targetHeight));
        return [targetWidth, Math.round(targetHeight)];
    },
};