react-native-image-viewer
react-native-image-viewer copied to clipboard
Not working with images requiring headers
Hi, imagine you have an image which needs auth headers to be downloaded.
Because you are trying to get the image size from the url with Image.getSize
, this fails and the image is not showed.
You can have a look to Image.getSizeWithHeaders to allow fetching the sizes in this common use case.
Same can be said for Image.prefetch
, but here it seems that RN does not yet support something like Image.prefetchWithHeaders
.
Currently the only workaround I've found is to disable preload and provide width and height ahead of time.
Does this help?
https://github.com/ascoders/react-native-image-viewer/issues/169
Nope. As you have written there, Image.getSizeWithHeaders should be used and to support also preload a similar prefetch method should be used (and maybe created too)