Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharing images from other apps removes EXIF location on Android > 10 #6248

Open
AykutCevik opened this issue Jun 8, 2020 · 59 comments
Open
Labels
approved bug feature: sharing to/from other apps hotspot: device storage Storage (on-device) related. Permissions, paths, inconsistencies, etc. hotspots: metadata Metadata (EXIF, GPS, etc.)

Comments

@AykutCevik
Copy link

AykutCevik commented Jun 8, 2020

Steps to reproduce

  1. Take a picture with a camera app which writes also GPS data into the picture
  2. Ensure GPS data is written into the picture with different apps like file browser or gallery app
  3. Upload this picture with the Nextcloud Android app version 3.11.1 via the share menu from gallery app
  4. Download picture from Nextcloud instance with a browser and look at the GPS data of the file
  5. 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
    grafik

Actual behaviour

  • Pictures are missing GPS data after upload
    grafik

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!

@AykutCevik AykutCevik added the bug label Jun 8, 2020
@strugee
Copy link
Member

strugee commented Jun 9, 2020

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 strugee added the needs info Waiting for info from user(s). Issues with this label will auto-stale. label Jun 9, 2020
@AykutCevik
Copy link
Author

@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.

@AykutCevik
Copy link
Author

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?

@AykutCevik AykutCevik reopened this Jun 9, 2020
@InfamousUser
Copy link

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.

@AykutCevik
Copy link
Author

Also to reference a comment which describes exactly the same thing: nextcloud/maps#361 (comment)

@strugee
Copy link
Member

strugee commented Jun 11, 2020

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.

@AykutCevik
Copy link
Author

@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.

@tobiasKaminsky
Copy link
Member

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.

@AykutCevik
Copy link
Author

AykutCevik commented May 10, 2022

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:
grafik

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.

@AykutCevik
Copy link
Author

@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.

@AlvaroBrey AlvaroBrey reopened this Jun 1, 2022
@AlvaroBrey AlvaroBrey removed the needs info Waiting for info from user(s). Issues with this label will auto-stale. label Jun 1, 2022
@fm-sys
Copy link

fm-sys commented Jun 6, 2022

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:

@AykutCevik
Copy link
Author

@AlvaroBrey any chance we get feedback on this issue since @fm-sys thankfully added more information?

@AndyXheli
Copy link

AndyXheli commented Jul 13, 2022

Hopefully a resolution soon on this

@2lian
Copy link

2lian commented Aug 7, 2022

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

Screenshot_20220807-110434res

Previously this setting was on "Allow access to media only".

@AndyXheli
Copy link

I get gps data on my Samsung S21 + with auto uploads on. It started to work. I have no idea what changed.

@2lian
Copy link

2lian commented Aug 7, 2022

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.

@AykutCevik
Copy link
Author

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.

@AlvaroBrey AlvaroBrey changed the title Upload through app removes GPS data from images Sharing images from other apps removes EXIF location on Android > 10 Aug 8, 2022
@Poldi1977
Copy link

The problem also occurs under Android 13 on a Pixel 4.

@AykutCevik
Copy link
Author

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?

@InfamousUser
Copy link

Nobody seems to care about these issues. And the amount of them is vast.

@nomandera
Copy link

nomandera commented Sep 3, 2023

Can i just clarify these responses because as I see it my logic HAS to be incorrect or this would be an absolutely horrendous critical bug that has been open for potentially 2+ years.

If it was probably by chance that the final file deletion was blocked by permissions on the device does this not mean that in some scenarios the NextCloud client is uploading files with incomplete metadata and then deleting the copy with complete metadata i.e. losing data.

Edit: I have now determined that as well as images videos have had GPS tags stripped as well.

@DAveShillito
Copy link

I think a recent update may have fixed the issue.
I just took a picture, and it auto uploaded and the version that arrived on my PC did have the location in the metadata.

@troygeiger
Copy link

I think a recent update may have fixed the issue. I just took a picture, and it auto uploaded and the version that arrived on my PC did have the location in the metadata.

I also just found that the location does auto-uploading on my Galaxy phone after discovering there is a location tag option in the camera app that was toggled off. Turned it on and sure enough, the location was in Nextcloud in the next picture I took.

@vb0
Copy link

vb0 commented Sep 27, 2023

Still happening on the latest non-beta from Play Store (3.26.0) on Pixel 7 with Android 13 (September update).

When testing it's worth sharing the following:

  • permissions, especially if you gave the special "All files access" one (it's a different UI for that). We know it works with that, and it's the current workaround.
  • which software version/branch and where it comes from (Play Store, F-Droid, side-loaded, etc.)
  • what's the phone manufacturer and which software is running (both as Android version/last update and if it's something like LineageOS).

@asm0dey
Copy link

asm0dey commented Oct 13, 2023

Thanks @vitis586, your fix worked for me! Is there any way to resync all the data now to upload the information to nextcloud?

@Cebrain
Copy link

Cebrain commented Oct 13, 2023

Thanks @vitis586, your fix worked for me! Is there any way to resync all the data now to upload the information to nextcloud?

You could create a new folder on your phone with the problematic media files.
Enable Auto Upload for this folder with the Upload Setting "Upload all existing files" and "Overwrite existing files"

You could also do this on you normal camera folder, if you want reupload everything.

@vitis586
Copy link

vitis586 commented Oct 13, 2023

Thanks @vitis586, your fix worked for me! Is there any way to resync all the data now to upload the information to nextcloud?

You can do what @Cebrain suggested. That is the most straightforward way how to do it.

I my case I had already done some changes to the EXIF before I noticed that it is missing location data. I then used exiftool to extract the position data to csv and then used this to update the already uploaded files.

@asm0dey
Copy link

asm0dey commented Oct 13, 2023

@Cebrain I want to reupload all from my camera folder, but do not understand how, sorry :(

@Cebrain
Copy link

Cebrain commented Oct 13, 2023

@Cebrain I want to reupload all from my camera folder, but do not understand how, sorry :(

This is no problem, you only need to disable the auto upload for the Camera folder. Save the setting.
Then enable Auto Upload again for Camera Folder with this 2 settings "Upload all existing files" and "Overwrite existing files"

@mrcg
Copy link

mrcg commented Oct 16, 2023

Manual activation of "allow access to all files" in android settings for the nextcloud app solves the issue.
Anyhow about 98% off all my applications have "allow accesss to all files" activated by default.
This kind of mandatory setting should be set by default when installing the nextcloud app as this is also done from the majority of other android apps. I have been struggling a lot on this topic and lot ofther users might complain as well. Nextcloud is already great but it will become even better in usability by such change.

AndyScherzinger pushed a commit that referenced this issue Nov 20, 2023
Signed-off-by: tobiasKaminsky <[email protected]>
@joshtrichards joshtrichards added the hotspot: device storage Storage (on-device) related. Permissions, paths, inconsistencies, etc. label Nov 21, 2023
@joshtrichards
Copy link
Member

joshtrichards commented Dec 6, 2023

This kind of mandatory setting should be set by default when installing the nextcloud app

@mrcg It already is. Well, it's requested at install time. The user can choose the other option on the pop-up though, which will obviously result in us not getting this permission:
image

@joshtrichards joshtrichards added hotspots: metadata Metadata (EXIF, GPS, etc.) and removed feature: auto upload labels Dec 6, 2023
@brilthor
Copy link

@mrcg It already is. Well, it's requested at install time. The user can choose the other option on the pop-up though, which will obviously result in us not getting this permission

I just moved to a new phone, had to freshly set up next cloud client. I did not receive this prompt.

I would also suggest the app should monitor to ensure it still has this permission before uploading corrupt data.

@joshtrichards
Copy link
Member

@brilthor Are you by chance on Android OS <11?

@brilthor
Copy link

@brilthor Are you by chance on Android OS <11?

Nope, Android 14 build UQ1A.231205.015

@vb0
Copy link

vb0 commented Jan 14, 2024

I think I mentioned it earlier, if the API that gives NextCloud zeroed out files has any return code that indicates it does that NextCloud should pay attention to it and notify quite prominently.

If there is no indication about that NextCloud could still detect this from the content of the files (these files don't just have no GPS data, they have zeroed out GPS data). Or, easier, instead of trying to do something fancy just read the GPS via some standard library and if nothing sane is returned just warn on the transfer notification (with the option to disable the extra text somewhere in settings). This could help also if the location permission gets removed from the Camera app (because of inactivity) or some other shenanigans happen in the next flavor of Android and the user starts generating pictures without location, while actually wanting this data to be saved. For the users that want no GPS tags it shouldn't be too bad if they get this spelled out in the transfer notification (with the option to have the text removed and basically revert to what we (don't) do now), might actually be a welcome confirmation that they still have the desired configuration.

@TippyTurtle
Copy link

To "fix" (er work around) this on a Pixel 8 Pro running Android 14 do the following:
Settings-->Apps-->Special App access (at the bottom)-->All Files Access-->Nextcloud-->Turn on "Allow access to manage all files"
...in addition to the standard "App Permissions" being set correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved bug feature: sharing to/from other apps hotspot: device storage Storage (on-device) related. Permissions, paths, inconsistencies, etc. hotspots: metadata Metadata (EXIF, GPS, etc.)
Projects
None yet
Development

No branches or pull requests