# compressImage

压缩图片 

## API 调用

### QN.app.invoke({api:'compressImage', query})

#### API 调用入参

参数名             | 类型       | 是否可选 | 默认值 | 含义
:-------------- | :------- | :--- | :-- | :-----------------------------------------------------------------------------------------------------------------------
`query`         | `Object` |      |     |
`query.data`  | `string` |  可选    |  iVBORw0KGgoAAAANSUhE... | 经过base64加密后的图片数据
`query.maxWidth`  | `number` |  可选    |  100 | 压缩后的最大宽度
`query.maxHeight`  | `number` |  可选    |  40 | 压缩后的最大高度


#### API 响应结果

参数名      | 类型  | 示例 | 含义
:------- | :-- | :----- | :---
`result` | `*` |        | 请求响应
`query.res`  | `string` |  <need>    |  <default> | 压缩后进行base64加密的图片数据


#### 调用示例

```javascript
QN.app.invoke({
      api:'compressImage',
      query:{
                data : 'iVBORw0KGgoAAAANSUhE...'  ,
                    maxWidth : 100  ,
                    maxHeight : 40  
            
      }
}).then(result => {
    console.log(result);
}, error => {
    console.log(error);
});
    
```
