Camera - get actual (permanent) path of picture from gallery, not cached one. #4306
-
Hi, I want people to see certain (selected) images from their gallery/photos in my App. I'm using the Capacitor Camera plugin to let them select the image:
When I get the path from the capturedPhoto it's a path to the cached image, not the 'real' one. This path is not permanent. I could move the image to another location (data) for permanent storage, but do I really want to store all the pictures they have already saved again? That seems like a massive waste of storage. Especially when we're talking tens to hundreds of images. All the tutorials on using Capacitor Camera are actually doing this, but they're usually taking a new picture where this kinda makes sense. But in my case it's not a smart solution. Is there any way to actually get the real path of the image? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Images that don’t belong to the app can only be accessed through content urls, the app needs permission to access those urls and the permission it’s only temporary. In some android versions you can still convert the content url to a file path and access it freely, but google makes it harder on every new android OS release. |
Beta Was this translation helpful? Give feedback.
-
Maybe the Capacitor community media plugin would help? |
Beta Was this translation helpful? Give feedback.
Images that don’t belong to the app can only be accessed through content urls, the app needs permission to access those urls and the permission it’s only temporary. In some android versions you can still convert the content url to a file path and access it freely, but google makes it harder on every new android OS release.