i am using Image.getSize from react-native it works fine on android but not in ios when the uri is an empty string

Viewed 212

enter image description here source.uri should not be an empty string

 await Image.getSize(
            uri && uri,
            async (width, height) => {
              //success
              //image still exist in the galory

              exist = true;
            },
            (error) => {
              num_messing_files++;
              // Failed
              // image do no exist any more in the galory [ what does exactly X represent]
            }
          );

1 Answers

You could check if the uri is an empty string before calling getSize instead of doing it inside.

if(uri){
 await Image.getSize(...)
}
Related