android
android copied to clipboard
Sharing images from other apps removes EXIF location on Android > 10
Steps to reproduce
- Take a picture with a camera app which writes also GPS data into the picture
- Ensure GPS data is written into the picture with different apps like file browser or gallery app
- Upload this picture with the Nextcloud Android app version 3.11.1 via the share menu from gallery app
- Download picture from Nextcloud instance with a browser and look at the GPS data of the file
- See that the GPS data is missing or more likely set to zero
Expected behaviour
- Pictures shouldn't lose their GPS data while uploaded through the app

Actual behaviour
- Pictures are missing GPS data after upload

Can you reproduce this problem on https://try.nextcloud.com?
- Upload through the browser to Nextcloud works fine, just app removes the informations
Environment data
Android version: 10 (OxygenOS 10.3.3) Device model: OnePlus 6T Stock or customized system: Stock Nextcloud app version: 3.11.1 Nextcloud server version: 18.0.5 Reverse proxy: Nginx
Logs
Web server error log
Nothing worth to mention
Nextcloud log (data/nextcloud.log)
Only related to "Maps" app while trying to analyze the image since the GPS data is wrong.
Nothing worth to mention
I faced this issue since I saw that the pictures weren't showing up in the Maps app of Nextcloud. So this is not a new issue. Also I can surely say that the problem started before 20th of April, so also with a prior version. I can share pictures in a PM.
Appreciate any ideas for solving this issue. Thank you for your great work!
3\. Upload this picture with the Nextcloud Android app version 3.11.1
How are you uploading the picture? Auto Upload? The "Upload files" button? The "Upload content from other apps" button?
Stock or customized system: FALSE
Does this mean you have a stock system? (I.e. the version of Android that came with your phone)
Reverse proxy: FALSE
I believe this question is asking what web server you access Nextcloud through.
@strugee updated the issue.
Trying several other uploads, I found out that the issue may not be related to the Nextcloud app itself.
I've uploaded pictures through the share menu from both apps:
- OnePlus stock gallery app
- Simple gallery app (com.simplemobiletools.gallery.pro)
Both uploads resulted in setting the GPS data to zero.
Upload through a file browser like "Amaze" or through the Nextcloud app itself didn't change the GPS data.
Tricky one! I will contact the app maintainers and reference to this issue here.
I have to reopen it again since I'm not quite sure how to debug this issue without brainstorming/information from here.
The "simple gallery" app provider said that they don't change the image beforehand. What could be the problem?
I think it is usual for sharing application to remove metadata, it used to be a huge privacy leak sending images over IMs that turned out to contain user's exact coordinates. Not sure if cloud backup tools should do it, they should not IMO, but it could be normal, somebody will know more about this.
Also to reference a comment which describes exactly the same thing: https://github.com/nextcloud/maps/issues/361#issuecomment-614571815
Upload through a file browser like "Amaze" or through the Nextcloud app itself didn't change the GPS data.
How exactly did you upload in all of these apps? Did you use the "Share" button in Amaze? In Simple Gallery? In the stock gallery? In general the more information and specifics contained in a bug report, the better.
@strugee as I said in point 3:
via the share menu from gallery app
This was the approach for all of the apps. The gallery app is stock, yes.
NC is not changing any metadata. You should easily find the causing app via uploading with different apps. If you can really reproduce it via NC please re-open.
Sorry, but I have to reopen this. It is still an issue, if I share a picture through the gallery or files app, nextcloud removes/nulls the GPS data all the time:

I tested this on a OnePlus 6T with Android 11 as well as on Samsung S21 Ultra with Android 12. On Samsung, I was even able to tick a checkbox prior sharing to keep the GPS data. Nextcloud itself removes them unfortunately.
@tobiasKaminsky can we reopen this issue please? It prevents me from uploading images through gallery apps which is way more convenient than doing it through the Nextcloud app.
Stripping EXIF data is part of the android Q privacy feature set.
Starting with Android 10 (or 11?), apps need to explicitly specify that they want to receive Metadata.
So it's indeed a bug in the nextcloud client, and not the fault of speciffic gallery apps.
You can read more about it here:
- https://stackoverflow.com/questions/68442139/exif-location-data-removed-when-sharing-photo-via-intent
- https://developer.android.com/reference/android/provider/MediaStore#EXTRA_ACCEPT_ORIGINAL_MEDIA_FORMAT
- https://issuetracker.google.com/issues/128675076
@AlvaroBrey any chance we get feedback on this issue since @fm-sys thankfully added more information?
Hopefully a resolution soon on this
I found a solution, not sure it works everywhere, but it fixed every upload done with the Nexcloud app (notably instant upload). (I have a OnePlus7 with Android 11)
Go to your phone Settings -> Privacy -> Permission Manager -> Files and Media. Find Nexcloud in the list and make sure to "Allow management of all file". This works for me

Previously this setting was on "Allow access to media only".
I get gps data on my Samsung S21 + with auto uploads on. It started to work. I have no idea what changed.
Tested some more. Funny thing is only instant upload and "Upload files" from the "all app" menu is working. The share button in Gallery app (this app has the same auth as Nextcloud) does not work, nor the "Upload files" for the "shared" menu in the Nextcloud app.
Uploading within the Nextcloud app already worked before in my case, it is cropping GPS data when you use the share functionality of other apps like gallery and files apps. They are way better in showing, organizing and selecting files and images than the Nextcloud app which makes it hard to use the in-app upload of NC regularly.
The problem also occurs under Android 13 on a Pixel 4.
Clearly, this is a case of data loss! If I wouldn't have found out and would just have all my photos in the nextcloud instance I would never be able to get back my GPS data in the photos. How is this issue not getting more attention? How many users may be already affected by this?
Nobody seems to care about these issues. And the amount of them is vast.
I don't speak for the development team but as a Nextcloud user I would encourage anyone who cares about seeing this get solved to open a PR. There seems to be a path forward described in https://github.com/nextcloud/android/issues/6248#issuecomment-1147167524 which should help you.
Is there any hope to get this fixed? Without valid metadata auto upload is completly useless.
The solution in privacy dashboard is not usable as there are only two options on Pixel 7.
Can you test this: https://github.com/nextcloud/android/pull/11161#issuecomment-1345998605 ?
Works for me @tobiasKaminsky
Seems to work for me too @tobiasKaminsky
I just stubled upon this too. Very frustrating as I had already deleted the originals on the phone when I was wondering where the GPS info is -.- Either way, this works on Google Pixel 7 Pro https://github.com/nextcloud/android/issues/6248#issuecomment-1207315271
@dbmaxpayne definitely! This data loss has to be addressed in a unit or integration test. I'm really wondering how at NC or nobody else faced this issue so far - maybe they don't know? People should check the maps feature in NC after upload to see if their photos are placed on the map or not.
I mean I really didn't notice until now and look at how old this thread already is. I only noticed, because my workflow has changed due to a new phone. Back then I always copied the files off the phone over the InstantUpload ones to get rid of them on the phone and to circumvent any upload issues I sometimes had with my old Samsung S7. I always wondered why Nextcloud on Windows would upload the files again without noticing they are actually the same. Now I know. They were never the same -.-
As I work quite a lot with the GPS data for example, I'd also vote for some sort of check in the Android app's code if it is allowed to upload the original file and display a warning if not. However, I am not deep enough into Android programming as to suggest a fix myself.
Either way it's a weird behavior by Android to remove data without any notification at all. Nextcloud seems to just be a victim here.
+1 on everything said. Would love to have gps data automatically uploaded with user permission. Media location not working from my auto upload setup from my Samsung S10. Have noticed for a while that my photos didn't show up on the map, but just getting around to pursuing a fix and the magical world of open source.
have anyone found a fix to this issue for the Sealife client on android? It seems like no one is responding to the issues opened by users. (https://github.com/haiwen/seadroid/issues/946)