react-native-blasted-image icon indicating copy to clipboard operation
react-native-blasted-image copied to clipboard

How can I read the image dimensions directly from cache?

Open Alexadru opened this issue 1 year ago • 0 comments

After onLoad fires the image is already cached. However there is no event returned in onLoad from where I can get the image size.

This is how you get the size directly from cache in react-native-fast-image:

e.g. onLoad={e => console.log(e.nativeEvent.width, e.nativeEvent.height)}

How can I read the size of the image directly from cache? Currently I'm using react-native'sImage.getSize to be able to get the image width and height, but that refetches the picture and makes the app too slow

Alexadru avatar Oct 08 '24 23:10 Alexadru