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

Fixing change in RCTImageFromLocalAssetURL behavior.

Open douglasjunior opened this issue 8 years ago • 7 comments
trafficstars

This change add onLoad and onLoadEnd for RCTImageFromLocalAssetURL image load.

In the most recent version of RN 0.50.x, it changed the RCTImageFromLocalAssetURL behavior. And then, now RCTImageFromLocalAssetURL also loads images from the web. So, react-native-photo-view is never calling the onLoad and onLoadEnd events.

I also opened a issue in RN repository to ask if this is intentional or a bug. facebook/react-native#16800

douglasjunior avatar Nov 12 '17 19:11 douglasjunior

@alwx - my RN version is 0.42.2 and I got error for RCTImageFromLocalAssetURL while building project. Could you review this PR to see whether it could resolve the issue?

just4fun avatar Dec 03 '17 11:12 just4fun

@just4fun RN 0.42.x is very old. Try to use an old version of photo-view.

douglasjunior avatar Dec 03 '17 12:12 douglasjunior

if (RCTIsLocalAssetURL(imageURL)){ UIImage *image = RCTImageFromLocalAssetURL(imageURL); [self setLoadingImage:image]; }

try this

asolas avatar Feb 02 '18 03:02 asolas

@asolas the problem here, is that in the most recent of React Native version the photo-view never call onLoad and onLoadEnd events on iOS.

@just4fun is trying to use this PR with a very older version of React native, it dont work.

douglasjunior avatar Feb 02 '18 12:02 douglasjunior

Who wants to try this PR, please use my Fork:

(remember, this will work for RN >= 0.50.0)

"react-native-photo-view": "git+https://github.com/douglasjunior/react-native-photo-view.git#patch-2"

@alwx please, could you look to this PR?

douglasjunior avatar Feb 02 '18 12:02 douglasjunior

@alwx maybe consider adding @douglasjunior as a contributor so he can make releases?

zackify avatar Jun 25 '18 23:06 zackify

@alwx @zackify's suggestion sounds good. Have you considered it?

rodrigobdz avatar Jul 16 '18 09:07 rodrigobdz