core
    正在准备搜索索引...

    接口 CompressImageData

    压缩图片

    interface CompressImageData {
        compressedHeight?: number;
        compressedWidth?: number;
        filePath?: string;
        quality?: number;
        src: string;
    }
    索引
    compressedHeight?: number

    压缩后图片的高度,单位为 px,若不填写则默认以 compressedWidth 为准等比缩放

    compressedWidth?: number

    压缩后图片的宽度,单位为 px,若不填写则默认以 compressedHeight 为准等比缩放。

    filePath?: string

    fs:// 路径格式的压缩后需要保存到的目标文件路径,留空则返回随机名称的临时文件路径。

    quality?: number

    压缩质量,范围 0~100,数值越小,质量越低,压缩率越高(仅对jpg有效)

    src: string

    fs:// 或 file:// 路径格式的图片路径