Closed wiliarko closed 6 years ago
Hey @wiliarko , behind the scenes the plugin uses NativeScript's ImageCache module which works with URLs. So you need to use a URL and not file path (something like file://........
).
thanks @PeterStaev it's work for me
Any more tips for this? I can't resolve similar issue :(
components.ts
`
mapPath: string = "~/assets/images/" + environment.mapName;
items: any[] = [];
ngOnInit() {
this.items.push({ file: this.mapPath });
}
`
.html `
`
For Random Url works fine, bu i need get image from file, any help?
@Archi20 , see my comment above. This should be a URL not a path.
So it is impossible to use file-path with this plugin?
You need to transform the file-path to file-url. Again see my first comment here. You can see what NS core class the plugin uses and in turn what that class supports.
@PeterStaev are you able to provide an example using file://
For example, I am saving the edited image to /data/user/0/au.com.sepccom.pl/files/5628_updated.png
How do I push this back to the viewModel imageUrl field so that the existing image is replaced with the edited version?
Thanks,
@sepccom , your url should look as any other file Url in nativecsript:
file:///data/user/0/au.com.sepccom.pl/files/5628_updated.png
Also providing user specific examples is not part of the free support of this plugin. If you wish we offer paid support for all of my plugins and you can buy one here: https://www.tangrainc.com/subscriptions/
how to display image file from local storage?
i can't display image from local storage.
System.err: java.net.MalformedURLException: Protocol not found: ~/storage/emulated/0/DCIM/Camera/NSIMG_20171027_52440.jpg