请扫码查看示例
 # getImageMetaData ^6.8
获取图片原始数据
# 请求参数
| Prop | Type | Comment | 
|---|---|---|
| src | String | 图片文件路径(相对路径) | 
# 引入接口模块
import bridge from '@minix-iot/etsbridge-sdk'
1
# 参数代码示例
let params = {
  src: 'localImages/weex_1598499691_0.jpg',
}
1
2
3
2
3
# 接口调用示例
let params = { src: this.src }
bridge
  .getImageMetaData(params)
  .then((res) => {
    console.log(res)
  })
  .catch((err) => {
    console.log(err)
  })
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
# 返回参数
- 成功时返回
| Prop | Type | Value | 
|---|---|---|
| code | Number | 0 | 
| width | Number | 图片原始宽度 | 
| height | Number | 图片原始高度 | 
| type | String | 图片格式 | 
| orientation | Number | 图片角度 | 
- 失败时返回
| Prop | Type | Value | Comment | 
|---|---|---|---|
| code | Number | -7 | 文件不存在 | 
| msg | String | - | 
# 返回示例
{
    "tempFilePath": "compress/test.jpg",
    "code": 0
}
1
2
3
4
5
6
2
3
4
5
6