react-native-photo-view icon indicating copy to clipboard operation
react-native-photo-view copied to clipboard

Possible to use react-native-fast-image for the image?

Open gitlovenotwar opened this issue 7 years ago • 11 comments

Hi,

The image seems to load again when it's mounted... I have a view when tap and shows the photoview, image is cached already using react-native-fast-image. Somehow it loads again, so I was wondering if it's possible to use it for the image.

gitlovenotwar avatar Aug 31 '17 10:08 gitlovenotwar

P.S. Everytime the image dismounted and mounted again, it loads again the image.

gitlovenotwar avatar Aug 31 '17 12:08 gitlovenotwar

Also ran into this. For some reason iOS caching is acting weird. Would be great if react-native-photo-view would provide a solution so that not all images are loaded every time a screen is mounted. It causes a lot of unnecessary downloads that are negatively impacting user-experience.

freerk avatar Apr 09 '18 21:04 freerk

+1

oferRounds avatar Jun 16 '18 11:06 oferRounds

+1

filipmadej avatar Aug 14 '18 12:08 filipmadej

+1

flyinghawker avatar Sep 18 '18 03:09 flyinghawker

+1

ahmaddehnavi avatar Jan 12 '19 14:01 ahmaddehnavi

It's over a year already when I posted this, and I haven't found any solution :(

gitlovenotwar avatar Jan 19 '19 03:01 gitlovenotwar

I think I found a solution. I am using react-native-cached-image and it is possible to get the local file name of a cached image by calling:

ImageCacheManager().downloadAndCacheUrl(url).then(cachedFilePath => { })

Then I use this when constructing the source prop of a PhotoView.

maartenvandillen avatar Feb 02 '19 16:02 maartenvandillen

@maartenvandillen,

Is react-native-cached-image still being maintained? Last commit was Oct 2017.

It also uses react-native-fetch-blob, which is definitely no longer being maintained. There is an active fork, rn-fetch-blob, but react-native-cached-image was never changed to use it.

brownieboy avatar Feb 15 '19 22:02 brownieboy

@brownieboy No it seems it is no longer being maintained. But I got everything working, by also adding the rn-fetch-blob package and making sure it is being used on the native side instead of react-native-fetch-blob. It's not a future safe solution, but what is these days.

maartenvandillen avatar Feb 18 '19 12:02 maartenvandillen

I had a look to see if there was an equivalent way of getting the cached file path in react-native-fast-image, but it seems not.

There have been two PRs submitted to add such functionality, but they don't seem to have been merged: https://github.com/DylanVann/react-native-fast-image/pull/228 https://github.com/DylanVann/react-native-fast-image/pull/351

brownieboy avatar Feb 23 '19 02:02 brownieboy