onurzorluer / react-image-file-resizer

Resize Local Images with React 🌄 🌅
MIT License
317 stars 41 forks source link

Data Uri to blob #18

Closed AliYmn closed 4 years ago

AliYmn commented 4 years ago

Hi, i think react-image-file-resizer need to data uri to blob. We can use this to upload image files and so it will be easier.

AliYmn commented 4 years ago

Sorry it was already included.

rikinshah23 commented 4 years ago

I have tried this but its shows me blank result. What am I doing wrong?


    var imageURI = '';
    const resizedImg = await Resizer.imageFileResizer(
      fileList.fileList[0].originFileObj,
      300,
      300,
      'JPEG',
      100,
      0,
      uri  => {
        imageURI = uri 
        console.log(uri )
      },
      'blob'
    );
    console.log(resizedImg)
    console.log(imageURI)