alwx / react-native-photo-view

Pinch-to-zoom view for React Native (both iOS and Android)
MIT License
816 stars 434 forks source link

Fixing change in RCTImageFromLocalAssetURL behavior. #122

Closed douglasjunior closed 1 year ago

douglasjunior commented 6 years ago

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

just4fun commented 6 years ago

@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?

douglasjunior commented 6 years ago

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

asolas commented 6 years ago

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

try this

douglasjunior commented 6 years ago

@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 commented 6 years ago

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?

zackify commented 6 years ago

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

rodrigobdz commented 5 years ago

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