react-native-photo-view: iOS unable to render local images

The images from asset-library and local image path returned by camera is not being rendered. Works fine with remote images though. Both http and https

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Reactions: 5
  • Comments: 30

Commits related to this issue

Most upvoted comments

I solved this in the iOS sim by prepending file:// to my uri, although I haven’t confirmed on device yet though.

The uri returned from the image picker was

/Users/yourUser/Library/Developer/CoreSimulator/Devices/32541D85-B1FD-441F-BB2B-B09850500F6C/data/Containers/Data/Application/DF622A86-5E4B-49C5-8DB5-0141BA339314/Documents/images/E136D41D-47E0-4264-AC79-E0D2A6210F49.jpg

So I changed my source to:

uri: 'file:///Users/yourUser/Library/Developer/CoreSimulator/Devices/32541D85-B1FD-441F-BB2B-B09850500F6C/data/Containers/Data/Application/DF622A86-5E4B-49C5-8DB5-0141BA339314/Documents/images/E136D41D-47E0-4264-AC79-E0D2A6210F49.jpg'

I ditched this library and unsubscribing from this thread.

@ManuBu This is my little implementation to fix the current issue - https://github.com/Warecorp/react-native-photo-view/commit/7a77dd5f519d1bf408111a9a2d21216a0d48e8d0

I didn’t implement a common approach because I am needed to show only local images (from document dir).

@srameshr Could you show your implementation or put it on GitHub? I have the same problem when getting the images using RN CameraRoll.

I created a PR (#96) for this issue.

I found the bounds (https://github.com/alwx/react-native-photo-view/blob/master/ios/RNPhotoView.m#L176) will be zero for the images with file:// uri (loaded from photo library or taken from camera). This makes the scaled image no size.