Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Support using local images #10

Open
mimmobordini opened this issue Jul 30, 2019 · 13 comments
Open

Support using local images #10

mimmobordini opened this issue Jul 30, 2019 · 13 comments
Labels
enhancement New feature or request

Comments

@mimmobordini
Copy link

is possible to use an image locally stored for using the app offline?

@songoten28
Copy link

songoten28 commented Aug 30, 2019

Same question.

@rodymolenaar
Copy link
Member

This is currently not supported, since we didn't have a business requirement for it.
We're using the built-in image loader from React Native on iOS and a custom one for Android. So adding local images, involves writing some more native code.

You're welcome to contribute :)

@rodymolenaar rodymolenaar added the enhancement New feature or request label Sep 24, 2019
@rodymolenaar rodymolenaar changed the title local images Support using local images Sep 24, 2019
@cristianoccazinsp
Copy link

I've been working on some bug fixes and improvements on my own fork (https://github.com/cristianoccazinsp/react-native-panorama-view/tree/updates). The fork is still not ready/finished, and perhaps not 100% adequate for a merge, but among other things, I've added local images support.

I'm not making a PR yet since I did some readme updates for my own fork, and removed some .ts / compilation steps in order to develop and test faster (having to run a build script or setup a .ts environment was too much of a hassle), but perhaps @rodymolenaar we can come up with a good way to merge these changes once I'm done with them.

@rodymolenaar
Copy link
Member

Alright! Just @ping me when you're done so that I can review it :)

@HossamSamir
Copy link

any updates on this?

@cristianoccazinsp
Copy link

cristianoccazinsp commented Aug 6, 2020

On my fork (https://github.com/cristianoccazinsp/react-native-panorama-view/tree/updates), it is working fine with a few extra install instructions. You may fork it and use it meanwhile, or wait for @rodymolenaar to finish the merge.

@starexrex
Copy link

starexrex commented Aug 6, 2020

On my fork (https://github.com/cristianoccazinsp/react-native-panorama-view/tree/updates), it is working fine with a few extra install instructions. You may fork it and use it meanwhile, or wait for @rodymolenaar to finish the merge.

Im expecting for this function, but i dont know how to put a route to local file in your fork. Im getting a black screen in the image show. I hope you can help to use this function.

@cristianoccazinsp
Copy link

cristianoccazinsp commented Aug 6, 2020

Should be as simple as imageUrl={file://path/to/your/file}

@starexrex
Copy link

starexrex commented Aug 6, 2020

Sorry but i cant make it work

<PanoramaView
style={{flex: 1}}
dimensions={{
height: Dimensions.get('window').height,
width: Dimensions.get('window').width,
}}
inputType="mono"
imageUrl={'file:/' + pathName}
/>

pathName is something like /data/data/com.reinadoapp/filesparquebolivar.jpg

@cristianoccazinsp
Copy link

First, you need to install the library directly from github, for example:

packages.json

"react-native-panorama-view": "github:cristianoccazinsp/react-native-panorama-view#updates",

Then, if you read the fork's install instructions, there's this:

Add the following to your project's Podfile (TODO: Remove this once CTPanoramaView is updated) pod 'CTPanoramaView', :git => 'https://github.com/cristianoccazinsp/CTPanoramaView.git', :branch => 'control-both' $ cd ios && pod install Note: You may need to delete your Podfile.lock file before running pod install

Then it should work. Keep in mind that the local file update was for files normally accessible to the app. If your file is bundled as static images, it may not work (I haven't really tested that)

@promit13
Copy link

does this support image added inside the app ?

@cristianoccazinsp
Copy link

For images stored on the device within the app's storage (e.g., taking a photo with a camera) it does. For images stored as static resources, I haven't really tested that case. I believe it should work if the images are static resources in react native, but it probably won't if they are java/IOS static resources.

@promit13
Copy link

@cristianoccazinsp Thanks !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants