Home > Software design >  i am using Image.getSize from react-native it works fine on android but not in ios when the uri is a
i am using Image.getSize from react-native it works fine on android but not in ios when the uri is a

Time:10-13

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]
            }
          );

CodePudding user response:

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

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