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

Not working with images requiring headers

Open Alb93 opened this issue 4 years ago • 2 comments

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.

Alb93 avatar Jul 08 '20 10:07 Alb93

Does this help?

https://github.com/ascoders/react-native-image-viewer/issues/169

PaitoAnderson avatar Jul 09 '20 21:07 PaitoAnderson

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)

Alb93 avatar Jul 15 '20 08:07 Alb93