Skip to content

Commit

Permalink
补充文件
Browse files Browse the repository at this point in the history
  • Loading branch information
wangcuijuan committed Dec 19, 2024
1 parent 7b34d47 commit 0a0a399
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions packages/api-proxy/src/platform/api/image/index.ios.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { envError, defineUnsupportedProps, successHandle, failHandle } from '../../../common/js'
import { Image } from 'react-native'

const previewImage = envError('previewImage')

const compressImage = envError('compressImage')

const getImageInfo = function (options = {}) {
const { src, success, fail, complete } = options
if (src === undefined) {
const result = {
errMsg: 'getImageInfo:fail parameter error: parameter.src should be String instead of Undefined;',
errno: 1001
}
failHandle(result, fail, complete)
return
}
if (src === '') {
return
}
Image.getSize(src, (width, height) => {
const result = {
errMsg: 'getImageInfo:ok',
width,
height
}
defineUnsupportedProps(result, ['path', 'orientation', 'type'])
successHandle(result, success, complete)
}, (err) => {
const result = {
errMsg: 'getImageInfo:fail download image fail. reason: ' + err
}
failHandle(result, fail, complete)
})
}

export {
previewImage,
compressImage,
getImageInfo
}

0 comments on commit 0a0a399

Please sign in to comment.