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 · 75 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?

@ghost
Copy link

ghost 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".

@ghost
Copy link

ghost commented Aug 7, 2022

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

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

@Defenso-QTH
Copy link

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

I tried this but nothing happens. I also tried killing the application between removing the setting and adding it again but to no avail.

@cooper2k4
Copy link

Hi all,

sadly I'm now also facing this issue (missing GPS Exif tags in pictures uploaded through Nextcloud App). I'm using a Google Pixel 7a and got the Android 15 update recently. Maybe this has something to do with it. I cannot add the above mentioned permission to the Nextcloud App. The Nextcloud App isn't in the list and can't be added to it.

@asm0dey
Copy link

asm0dey commented Dec 27, 2024 via email

@Cebrain
Copy link

Cebrain commented Dec 27, 2024

Hi all,

sadly I'm now also facing this issue (missing GPS Exif tags in pictures uploaded through Nextcloud App). I'm using a Google Pixel 7a and got the Android 15 update recently. Maybe this has something to do with it. I cannot add the above mentioned permission to the Nextcloud App. The Nextcloud App isn't in the list and can't be added to it.

Same problem for me now, i used the workaround now for a long time.
Nextcloud went now missing from the Special Apps permission.

Everyone, that had it working before please check your permission!!!

This is again a major problem, exact same problem as last time.
This setting also breaks now all backup jobs on your phone for file which are not Media Files!

For me the last day it worked was one 23rd September 2024.
Cant say for sure if it was an Nextcloud App Update or Phone System Update

Check your files!

Edit:
Check now a Pixel and a OnePlus phone.
On both phones App Nextcloud is now missing from the Special Permission "Access all files"
This are great news... will need to backup all pictures/videos manually and hope my family did not delete media files they thought they are already fine saved in the cloud...

As i can see, for the moment no way to get the GPS data back, but the upload for all other NON media files from within the nextcloud.

Edit2:
Sorry for the Spam, but probably important infos for some in the thread ;)

I checked the open issues
#14199
#14135

PR for requesting the Media Location Permission
#14247

Someone created an APK from the PR (did not test)
#14135 (comment)
#14247 (comment)

@Cebrain
Copy link

Cebrain commented Jan 6, 2025

New Info, if you use the nextcloud application from the fdroid store, it will ask again for the permission.
Google did remove the permission. The fdroid version is working fine.

@vb0
Copy link

vb0 commented Jan 6, 2025

Confirmed, it happened again, the permission just went away from the Play Store app! Last time some people lost 1-2 years of GPS metadata, now it's been about a month- or up to a few months.

No matter if this or that version or workaround still works we don't know for how long, and how the next problem will look. I'd strongly reiterate my previous suggestion to detect and warn if we aren't getting GPS data.

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.

@DAveShillito
Copy link

Thanks to this thread I discovered I was losing the GPS data again, it seems to have occurred some time between the 14th & 18th December, so only a few files were affected and I could sync them off the phone.

Is this a permission we can allow ourselves? or is switching to the fdroid version the only reliable workaround?

@dbmaxpayne
Copy link

I can confirm that it has also happened again to me on a Google Pixel 7 Pro.

@M3talGuy
Copy link

Yup, happened to me as well (Pixel 8 Pro). Synced Images up to Dec 14th still have GPS data, Images synced December 17th and later do not (no Images where taken on 15th and 16th). And yes, the NC App disappeared completely form the "Access all files" section , where i had set the option before as well.

@vb0
Copy link

vb0 commented Jan 15, 2025

Eventually I moved to immich for the photo storage. It's supreme in do many aspects that I didn't even hesitate

This isn't much different for this type of issue, except for just being a different program that breaks at different times depending on who knows what Play Store policies, various OEM configurations, etc.

immich-app/immich#2965
immich-app/immich#13188
immich-app/immich#11280
immich-app/immich#11264

@AykutCevik
Copy link
Author

This is so annoying... As others stated, it is happening again. The GPS data got zeroed-out. Not sure when it was the last time it worked and totally annoying to trace back the date and re-upload it again via a PC rather than using the app.

To be honest Nextcloud team, I don't get why this still is an issue and not handled with priority. This causes unrecoverable data loss and the problem is, that most of the users don't even know.

Nextcloud Android App Version: 3.30.7 from PlayStore.

@Defenso-QTH
Copy link

Defenso-QTH commented Jan 16, 2025

Since we cannot control Google's policies on the Play Store, I think the best workaround would be:

  • Checking and displaying a warning on every upload if the app cannot read GPS info. (Warning that could be silenced in settings for users who do not care.)
  • Enabling users to easily re-upload media that does not GPS info easily - or transfer only that information to update the files on the NextCloud remote.

Moving to Immich is not currently an acceptable solution for FreeBSD users like myself since they do not provide a raw installer, only a docker-based setup, which is not currently supported under FreeBSD.

@Ra72xx
Copy link

Ra72xx commented Jan 16, 2025

As I see it the problem also occurs when using the Nextcloud app's auto upload feature. At least that was the reason I discovered this bug report.
While I have some understanding that "sharing" does some stuff to the pictures according to the demands of the recipient service, "uploading" for me implies exact 1:1 copies, everything else is nothing else but data loss.
So is it possible that the Nextcloud app uses the wrong Android mechanism for its uploading? Standard WebDAV e. g. should never ever mess with the content it transports.

@vb0
Copy link

vb0 commented Jan 16, 2025

No, this is not the problem, the OS is presenting a zeroed out file to NC. It doesn't matter what it does with it afterwards, the damage is done.

@Ra72xx
Copy link

Ra72xx commented Jan 16, 2025

Really? This would be deliberately destroying a file, which is IMHO unacceptable. This doesn't happen when copying the pictures as files with other options, e. g. FolderSync or any file explorer (at least I hope so). So I assumed that the Nextcloud app should simply access the pictures as files and not as media.

@vb0
Copy link

vb0 commented Jan 16, 2025

Everyone is in the same boat, hanging for dear life on the discussed permission. Sure, a file manager might have a lower chance to have it randomly yanked, doubly so if it's the default OS file manager, but there's nothing fundamentally different.

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