react-native-webp-format
react-native-webp-format copied to clipboard
Image.getSize() always returns 0 on iOS when used the webP images
Image.getSize() always returns 0 width and 0 height.
Can anyone know how to fix this up?
Anyone ? :)
The library react-native-image-zoom uses Image.getSize() as well but it does return width=0 and height=0 when using webp on ios <14.
I have no knowledge of how this librarie work but could it be possible to "overload"/"change" how the getSize function work, so it can find webp dimensions as well ?
You need to use: const {width, height} = Image.resolveAssetSource(require('./assets/1.sm.webp'));
instead of Image.getSize()