React-Native: Convert image url to base64 string

前端 未结 9 560
轻奢々
轻奢々 2020-12-08 19:03

I\'m building a react native app that needs to store images at base64 string format for offline viewing capabilities.

What library / function would give me the best

9条回答
  •  甜味超标
    2020-12-08 19:59

     ImageEditor.cropImage(imageUrl, imageSize, (imageURI) => {
          ImageStore.getBase64ForTag(imageURI, (base64Data) => {
              // base64Data contains the base64string of the image
          }, (reason) => console.error(reason));
     }, (reason) => console.error(reason));
    

提交回复
热议问题