You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I optionally donated to support the Fossify mission.
Feature description
If a third party application wants to retrieve an image and you decide to use this app for selecting, the location metadata should not be deleted and should also be made available to the third party application.
This is the android file selection dialog from which you can select this Gallery app ("Galerie").
Why do you want this feature?
My specific scenario:
I want to upload some of my pictures to my nextcloud and see them on a map.
I've used the android app Memories to upload some photos.
The selection process there is done via an ACTION_PICK Intent (i guess) which opens the native file selection dialog of android.
There i choose this gallery app and select some pictures.
When the pictures are returned to the Memories app, the location metadata field is empty. So I can't use this data in my nextcloud.
General use case
Selecting the image from another app for example for uploading or sharing it, should also share the location metadata and should not modify the file.
Additional information
I've also analysed it for my specific scenario and written a small fix.
I've tested it with the Memories app and I've written a small app myself that "asks" for an image via the Intent.ACTION_PICK and reads the location from the EXIF in the result. For both of them, this works.
I could fix the problem by copying the file to a cache folder and providing the public uri of that cached file instead of the original.
diff --git a/app/src/main/kotlin/org/fossify/gallery/activities/MainActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/MainActivity.kt
index 834453471..e73d065ab 100644
--- a/app/src/main/kotlin/org/fossify/gallery/activities/MainActivity.kt+++ b/app/src/main/kotlin/org/fossify/gallery/activities/MainActivity.kt@@ -880,9 +880,15 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
private fun fillIntentPath(resultData: Intent, resultIntent: Intent) {
val data = resultData.data
val path = if (data.toString().startsWith("/")) data.toString() else data!!.path
- val uri = getFilePublicUri(File(path!!), BuildConfig.APPLICATION_ID)- val type = path.getMimeType()- resultIntent.setDataAndTypeAndNormalize(uri, type)++ // copy the file to the cache directory to keep all exif data like location+ val file = File(path!!)+ val cacheFile = File(cacheDir, file.name)+ file.copyTo(cacheFile, true)++ val cacheUri = getFilePublicUri(cacheFile, BuildConfig.APPLICATION_ID)+ val type = cacheFile.path.getMimeType()+ resultIntent.setDataAndTypeAndNormalize(cacheUri, type)
resultIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
}
Limitations:
I don't know, if this only works on my phone or if there is a better way to do this.
I also think that this needs to be fixed when sharing a picture from this gallery app to another third-party app.
It should be under the option, where the default is removing location data while sharing. I'd even add a setting to remove all EXIF data, as requested here for another sharing scenario (sharing from Gallery to other apps): #185.
Even better, these two requests should be done at once.
I wonder if this is the reason the gallery's built-in editor is stripping out all the EXIF data from my images, including the date it was taken. In many cases, I'm editing a photo for my own use, or to upload to iNaturalist, in which case I usually want to keep all the metadata including the location, or most of the metadata but not location.
Checklist
Feature description
If a third party application wants to retrieve an image and you decide to use this app for selecting, the location metadata should not be deleted and should also be made available to the third party application.
This is the android file selection dialog from which you can select this Gallery app ("Galerie").
Why do you want this feature?
My specific scenario:
I want to upload some of my pictures to my nextcloud and see them on a map.
I've used the android app Memories to upload some photos.
The selection process there is done via an ACTION_PICK Intent (i guess) which opens the native file selection dialog of android.
There i choose this gallery app and select some pictures.
When the pictures are returned to the Memories app, the location metadata field is empty. So I can't use this data in my nextcloud.
General use case
Selecting the image from another app for example for uploading or sharing it, should also share the location metadata and should not modify the file.
Additional information
I've also analysed it for my specific scenario and written a small fix.
I've tested it with the Memories app and I've written a small app myself that "asks" for an image via the Intent.ACTION_PICK and reads the location from the EXIF in the result. For both of them, this works.
I could fix the problem by copying the file to a cache folder and providing the public uri of that cached file instead of the original.
Limitations:
I don't know, if this only works on my phone or if there is a better way to do this.
I also think that this needs to be fixed when sharing a picture from this gallery app to another third-party app.
Tested with: Android 12 (MIUI 13.0.1), Fossify Gallery 1.1.3
The text was updated successfully, but these errors were encountered: