android icon indicating copy to clipboard operation
android copied to clipboard

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

Open AykutCevik opened this issue 5 years ago • 18 comments

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 avatar Jun 08 '20 11:06 AykutCevik

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 avatar Jun 09 '20 05:06 strugee

@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 avatar Jun 09 '20 08:06 AykutCevik

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 avatar Jun 09 '20 11:06 AykutCevik

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.

InfamousUser avatar Jun 10 '20 21:06 InfamousUser

Also to reference a comment which describes exactly the same thing: https://github.com/nextcloud/maps/issues/361#issuecomment-614571815

AykutCevik avatar Jun 11 '20 09:06 AykutCevik

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 avatar Jun 11 '20 09:06 strugee

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

AykutCevik avatar Jun 11 '20 09:06 AykutCevik

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.

tobiasKaminsky avatar Jul 01 '20 11:07 tobiasKaminsky

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 avatar May 10 '22 14:05 AykutCevik

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

AykutCevik avatar May 31 '22 20:05 AykutCevik

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

fm-sys avatar Jun 06 '22 08:06 fm-sys

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

AykutCevik avatar Jul 12 '22 16:07 AykutCevik

Hopefully a resolution soon on this

AndyXheli avatar Jul 13 '22 17:07 AndyXheli

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

2lian avatar Aug 07 '22 02:08 2lian

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

AndyXheli avatar Aug 07 '22 02:08 AndyXheli

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.

2lian avatar Aug 07 '22 02:08 2lian

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.

AykutCevik avatar Aug 07 '22 07:08 AykutCevik

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

Testorakel avatar Aug 30 '22 14:08 Testorakel

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?

AykutCevik avatar Oct 31 '22 08:10 AykutCevik

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

InfamousUser avatar Oct 31 '22 10:10 InfamousUser

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.

strugee avatar Oct 31 '22 19:10 strugee

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.

stephan-l avatar Dec 11 '22 23:12 stephan-l

Can you test this: https://github.com/nextcloud/android/pull/11161#issuecomment-1345998605 ?

tobiasKaminsky avatar Dec 12 '22 07:12 tobiasKaminsky

Works for me @tobiasKaminsky

AykutCevik avatar Dec 12 '22 16:12 AykutCevik

Seems to work for me too @tobiasKaminsky

stephan-l avatar Dec 12 '22 22:12 stephan-l

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 avatar Dec 30 '22 22:12 dbmaxpayne

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

AykutCevik avatar Dec 30 '22 22:12 AykutCevik

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.

dbmaxpayne avatar Dec 31 '22 12:12 dbmaxpayne

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

whitemanthedj avatar Jan 13 '23 03:01 whitemanthedj

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)

rikrdo89 avatar Mar 14 '23 13:03 rikrdo89