智能照明系统APP-本地串口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
LightingSystemApp-serial/.svn/pristine/be/be93fd76a8f1657863e9a34f4a3...

28 lines
486 B

import {
TEMP_PATH
} from '../constants'
import {
invoke
} from '../../bridge'
export function compressImage ({
src,
quality
}, callbackId) {
var dst = TEMP_PATH + '/compressed/' + Date.now() + (src.match(/\.\S+$/) || [''])[0]
plus.zip.compressImage({
src,
dst,
quality
}, () => {
invoke(callbackId, {
errMsg: 'compressImage:ok',
tempFilePath: dst
})
}, () => {
invoke(callbackId, {
errMsg: 'compressImage:fail'
})
})
}