Expo React-Native getSize() method returns wrong height and width of remote Image

Viewed 123

I have project where I am trying to get remote image dimensions with getSize() method, problem is that this method returns wrong dimensions for IOS and Android, After many searches I could not find proper solution, If anyone has had a similar case has there been a similar plugin for it? and what is proper way to get original dimensions for Android and IOS

Image.getSize(myUri, (width, height) => {this.setState({width, height})});
1 Answers

I also searched for a solution to this problem for a long time, and finally decided to modify react-native-fast-image a little and added the preloadDimension method to it, which does the same as getSize only returns the real size of the image. I also use the same library to show the image, which solves the problem of quality reduction

https://github.com/valery-lavrik/react-native-fast-image

Related