resizeImage
Requires:
BizKit≥3.0.0@ray-js/ray≥0.3.23
Platforms:
iOSAndroid
Method signature
resizeImage(params: )Minimum SDK versions
- iOS
ThingSmartBizKitBizBundle - ≥ 5.2.1
- Android
com.thingclips.smart:thingsmart-bizbundle-bizkit - ≥ 5.2.0
Description
Compress an image: first crop to the target size while preserving the original aspect ratio, then apply quality compression based on the file size limit
Parameters
| Property | Type | Required | Description | Minimum SDK versions |
|---|---|---|---|---|
aspectFitWidth | number | Yes | Compression parameters aspectFitWidth Adaptive width | — |
aspectFitHeight | number | Yes | aspectFitHeight Adaptive height | — |
maxFileSize | number | No | maxFileSize Maximum image file size limit; if empty, no limit. Unit: B | — |
path | string | Yes | path Image path | — |
complete | () => void | No | Completion callback (executed on both success and failure) | — |
success | (params: Object) => void | No | Callback on successful API call | — |
fail | (params: Object) => void | No | Failure callback | — |
success callback parameters
| Property | Type | Description | BizKit Since | Minimum SDK versions |
|---|---|---|---|---|
path | string | Image return content path Image path | v3.1.2 | — |
fail callback parameters
| Property | Type | Description |
|---|---|---|
errorMsg | string | Error message |
errorCode | string | number | Error code |
| Error extension |
Return Value
None