fsioi
C大,是我设置出问题了吗,希望C大答复下
【上传】和【输出】两项设置都要写的,上传是哪些图片会经过前端压缩,输出是压缩后的格式。
可以像本站这样设置,width和height是限制最大宽高的,不加的话保持原始尺寸。
//【压缩】
////_*: 输出格式模板 对象键名任意
////width: 转换后最大宽度
////width:(undefined)||null||false 不限制
////height: 转换后最大高度
////height:(undefined)||null||false 不限制
////fill: 背景填充色
////fill:(undefined)||null||false 透明
////format:image/png||image/jpeg||image/webp 输出格式选项
////format:(undefined)||null||false image/png
////quality:<0.01-1> 压缩比例 输出格式image/png无视该项
////quality:(undefined)||null||false 0.9
////render:{} CanvasRenderingContext2D 渲染属性
////render:(undefined)||null||false 使用浏览器默认
_png:{width:2048,height:2048,fill:null,format:"image/png",quality:0.9},
_jpg:{width:2048,height:2048,fill:"#FFF",format:"image/jpeg",quality:0.9},
_webp:{width:2048,height:2048,fill:null,format:"image/webp",quality:0.9},
//【上传】
////png|jpg|bmp|ico|gif|webp: 指定格式设置
////normal: 常规输出使用哪个模板
////normal:(undefined)||null||false 使用脚本默认
////nowebp: 浏览器不支持webp输出时使用哪个模板
////nowebp:(undefined) 继承normal模板
////nowebp:null||false 不压缩直接输出
////animate: 图片检测到动画时使用哪个模板
////animate:(undefined) 继承normal模板
////animate:null||false 不压缩直接输出
png:{normal:"_webp",nowebp:"_png",animate:false},
jpg:{normal:"_webp",nowebp:"_jpg"},
bmp:{normal:"_webp",nowebp:"_jpg"},
ico:null,
gif:{normal:"_webp",nowebp:"_jpg",animate:false},
webp:{normal:"_webp",nowebp:"_png",animate:false},