let photoSelectOptions = new picker.PhotoSelectOptions();
photoSelectOptions.MIMEType = picker.PhotoViewMIMETypes.IMAGE_TYPE;
photoSelectOptions.maxSelectNumber = maxSelectNumber;
let photoPicker = new picker.PhotoViewPicker();
photoPicker.select(photoSelectOptions).then((photoSelectResult: picker.PhotoSelectResult) => {
console.info('PhotoViewPicker.select successfully, photoSelectResult uri: ' + JSON.stringify(photoSelectResult));
onSuccess(photoSelectResult)
}).catch((err: BusinessError) => {
console.error('PhotoViewPicker.select failed with err: ' + JSON.stringify(err));
onError(err)
});
获取图库图片后,拿到图片uri,如何计算图片md5值?
请参考以下demo:
md5计算参考如下:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-file-hash-V5\#hashhash