提交 70041fbc 编写于 作者: Y yurj26

feat(app): compressImage兼容参数compressedWidth、compressedHeight

上级 a65e2788
......@@ -14,6 +14,13 @@ import {
export function compressImage (options, callbackId) {
const dst = `${TEMP_PATH}/compressed/${Date.now()}_${getFileName(options.src)}`
const errorCallback = warpPlusErrorCallback(callbackId, 'compressImage')
const { compressedWidth, compressedHeight } = options
if (typeof compressedWidth === 'number') {
options.width = compressedWidth + 'px'
}
if (typeof compressedHeight === 'number') {
options.height = compressedHeight + 'px'
}
plus.zip.compressImage(Object.assign({}, options, {
dst
}), () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册