Android yet again being entirely too "helpful"
May 3, 2024 3:54 AM   Subscribe

How can I stop an Android phone from stripping GPS information from photos in the process of copying them?

Phone is a Blackview BV8000Pro running Android 8.0.0. After taking a photo with location services turned on, viewing that photo in the Gallery app and choosing Details from its three-dots menu shows the location where it was taken, proving that GPS information is present inside the photo's EXIF data.

But after making a copy of any such photo by any means I've tried, including sharing via email, or sharing via Dropbox, or accessing the phone from a computer via MTP over a USB cable, or even simply copying the file to another folder on the phone itself with either the inbuilt File Manager app or the usually wholly reliable Cx File Explorer, the copy has no GPS information in it. Non-GPS EXIF tags are copied correctly. It's only the GPS tags that get stripped.

Cx File Explorer can show cryptographic checksums for any file it can see, and the checksums it shows on copied versions always match those on the originals, so the GPS stripping isn't happening during the copy operation; it seems that Android is suppressing the GPS tags whenever anything but the Gallery app looks at the file.

This smells like an overzealous privacy setting to me, but I do not know where to look for such a setting or what its name might be. Do you?
posted by flabdablet to Computers & Internet (17 answers total) 1 user marked this as a favorite
 
Response by poster: In case this helps: the phone is not mine, and its owner tells me that GPS tagging used to work as expected. This misbehaviour is recent and apparently spontaneous, so if it is indeed a rogue privacy setting it will probably be one that's easy to trigger by accident.
posted by flabdablet at 3:57 AM on May 3


When you say that even MTP copying doesn't work, do you mean that if you copy a photo from the phone to a computer, the GPS info doesn't show up on the copy when viewed on the computer (i.e., not through the Gallery app the phone uses)? Even if the checksum is the same?

Anyway, according to this thread it might be a permissions issue.

FWIW, this is not something I've ever experienced on Android that I can remember. My (much more recent) Android version specifically gives me an option to strip location data any time I use the Share feature, and just leaves it alone when doing a regular copy. That might be a Samsung thing, though. Does Blackview do much Android customization?
posted by trig at 4:51 AM on May 3


Best answer: Cx File Explorer can show cryptographic checksums for any file it can see, and the checksums it shows on copied versions always match those on the originals, so the GPS stripping isn't happening during the copy operation;

This doesn't make sense. If the checksum in the original matches the data in the copy, and the data in the copy doesn't have GPS data in it, then neither does the original. The GPS information is being stored somewhere else and Gallery is pulling it from there.
posted by mhoye at 5:42 AM on May 3 [1 favorite]


Response by poster: When you say that even MTP copying doesn't work, do you mean that if you copy a photo from the phone to a computer, the GPS info doesn't show up on the copy when viewed on the computer (i.e., not through the Gallery app the phone uses)? Even if the checksum is the same?

The checksums as calculated on the computer, whether looking at the file directly inside the MTP mount or on a copy made from there, match those that Cx File Explorer shows on the phone for both the original file and any local copy that either Cx File Explorer or the native File Manager app has made.

The only version with GPS info available is the original file on the phone, and the only tool I have that can reveal that info is the phone's Gallery app, despite Cx File Explorer showing the same checksums for that file and copies made of it. Gallery shows the copy as having no GPS info.

Obviously the actual checksums for the version that does have the GPS tags in it would have to be different from those that don't, which is why I've concluded that photo file content is being fucked with by some filter that inserts itself in the access chain for any app other than Gallery.

The GPS information is being stored somewhere else and Gallery is pulling it from there.

That's also consistent with what I'm seeing. Any clue where and/or in what format?
posted by flabdablet at 5:51 AM on May 3


Response by poster: according to this thread it might be a permissions issue.

I went to Settings/Apps & Notifications/App Permissions/Advanced/Special app access/Unrestricted data access, turned that on for Cx File Explorer, and rebooted. It's still showing the same checksums for the original of a photo I just took and for the copy I made of it earlier, and Gallery is still showing location information only for the original and not for the copy.

Cx File Explorer has its own inbuilt image viewer which exposes an Info button when viewing an image, and the EXIF information shown by that has no location data in it for the original nor the copy, which is consistent with its having shown matching checksums for both.

Does Blackview do much Android customization?

Haven't investigated extensively but it feels more plain vanilla to me than any Samsung device I've ever used.
posted by flabdablet at 6:09 AM on May 3


Best answer: I'm curious if this still happens using a different camera app, like Open Camera?

Which gallery and photo apps are being used - who makes them?
posted by trig at 6:30 AM on May 3 [1 favorite]


Response by poster: How would I find that out? They're just called Gallery and Camera and I believe they're whatever came with the phone.

There's another thing called Geotag that takes photos. I took one with that and it made two files, one with _stamped at the end of the filename which I gather is supposed to have GPS info overlaid on the image. The one without _stamped, which I gather is the original, shows GPS info when viewed in Gallery. The one with it shows no GPS info and also has nothing extra overlaid on the photo, which is consistent with the Geotag app also being unable to read GPS metadata from a stored photo even though it wrote that photo out itself.

This Android installation seems hell-bent on hiding GPS tags from anything that isn't Gallery.
posted by flabdablet at 6:48 AM on May 3


long press and hold on the icon, and pull up the app details. You should be able to see publisher, etc. The list of apps in the settings (not in the Play Store) will also list the APK name.
posted by sagc at 6:51 AM on May 3


Response by poster: I can't see publisher info for either app. Closest I get is a version number at the bottom of the "App info" page, which is 1.1.60030 for Camera and 1.1.40030 for Gallery.

Did I mention that I loathe and detest phones? Oh how I loathe and detest phones.

I just did the long press for Cx File Explorer and its "App info" page, unlike Camera or Gallery, has a "Store" section at the bottom with an "App details" subhead over "App installed from Google Play Store". So I'm guessing the lack of that for Camera and Gallery means that they are indeed the ones that came with the phone.

Cx File Explorer shows that the Android/data subfolder in Main Storage has subfolders including com.android.gallery3d and com.mediatek.camera. I can't see any other subfolders with "gallery" or "camera" in their names.
posted by flabdablet at 7:07 AM on May 3


Confirm that the camera app "Save location" setting (under settings -> more settings) is turned on.

I believe if this setting is off you'll still be able to see the location in Google Photos via some other location db but it won't be written to the file's exif data. The setting didn't exist until a few years ago, and in at least some cases defaults to off (which is terrible UX, of course). Various exif metadata viewer apps are available which you can use to confirm whether the file has exif data or not.

Probably irrelevant tangent: Google made a change in Android versions ~9-10 which introduced a new ACCESS_MEDIA_LOCATION permission that apps need to request before they can read exif data from images. If you export a photo through an app that wasn't updated to handle this, it will have its exif data redacted even if the exif data was originally written to the file. The groundwork for this change started being laid in android 8 or 9, and although it wasn't supposed to be required at that point, there were some edge-case bugs in Google's early implementation that could cause redaction in cases where it shouldn't have (I worked on this professionally but no longer remember if it affected Android 8 or only 9). However I doubt this is your problem. Reputable apps were updated to adapt to this change several years ago; plus, an app permissions bug wouldn't explain why you are seeing this so consistently, even when copying over USB, nor why the checksum does not change.
posted by introcosm at 7:39 AM on May 3 [1 favorite]


Response by poster: I just installed Open Camera, and after giving it location permissions in the system settings and turning on all the location-saving options inside its own settings, took a photo with that. And that photo's location info not only survives being copied to other folders by File Manager or Cx File Explorer according to Gallery, but also appears when the phone is accessed via MTP over USB.

Then I took another photo with the original Camera app just to verify that it still inherits the same weird behaviour as before, and it did.

So it looks like the OEM Camera app is, as mhoye suggested, storing location metadata somewhere that isn't inside the image file proper and conspiring with the OEM Gallery app to reveal it, while Open Camera just makes standard JPEGs with standard GPS EXIF tags inside like God intended. Dunno why I saw the same broken behaviour when taking photos with the Geotag app. Perhaps it's handing off the actual snappy snapping to Camera.

Confirm that the camera app "Save location" setting (under settings -> more settings) is turned on.

I believe if this setting is off you'll still be able to see the location in Google Photos via some other location db but it won't be written to the file's exif data.


Phone is using Gallery, not Google Photos, but that scenario is consistent with what's happening.

Tapping the Camera app's internal gear wheel icon exposes a Settings page with options for self timer, picture size, ZSD, anti flicker and CaptureSound. There's no "more settings" section that I can see. This might be because it's some broken little Mediatek app rather than the stock Android one.

If there is indeed a way to turn that setting off, it's probably more discoverable accidentally than on purpose - which would explain why this shit just seemed to start happening on its own.

What a way to run a railroad. I hate phones.

I'll hook Open Camera up to the phone's quick-access camera button and call this Job Done. Thanks, all.
posted by flabdablet at 8:07 AM on May 3 [1 favorite]


If introcosm's advice doesn't work, I would try installing Open Camera (fdroid, Play store) and trying with that.

Because Android 8 is so old it's possible that up-to-date apps might not play perfectly with the permissions system from back then, but it's worth a try.

Are all the GPS/location settings for both the phone and the camera app definitely turned on? Apparently Android can get estimated location data via cell towers and so on, but doesn't necessarily treat that data in the same way as actual GPS coordinates; it might not be used for EXIF data (I don't know this for a fact, just saw in mentioned in some places).
posted by trig at 8:07 AM on May 3


I also saw a thread that mentioned that Google Photos apparently/supposedly was able to add GPS data as EXIF info retroactively. Is there any chance your friend had been using Google Photos until recently, or made any other change to their workflow?

I would also be extremely surprised if the phone was still getting OS updates of any sort, but just to chase down possibilities, is there any chance there was some recent security update?
posted by trig at 8:11 AM on May 3 [1 favorite]


Jinx. Glad there's a workaround.
posted by trig at 8:20 AM on May 3


Response by poster: Are all the GPS/location settings for both the phone and the camera app definitely turned on? Apparently Android can get estimated location data via cell towers and so on, but doesn't necessarily treat that data in the same way as actual GPS coordinates

Under Settings/Security & Location/Location/Mode there are three options:

High accuracy
Use GPS, Wi-Fi, Bluetooth, or mobile networks to determine location

Battery saving
Use Wi-Fi, Bluetooth, or mobile networks to determine location

Device only
Use GPS to determine location

It was set to "High accuracy". I tried switching it to "Device only" to see what would happen.

Open Camera refused to take a photo at all, because I'd turned on its option to do that whenever it's supposed to save location information but can't get a location, and I'm under a steel roof here. Camera just took a photo without a geotag.

Went outside and waited for Open Camera to be happy to take a photo, which took half a minute while satellites got acquired, then took another photo with Camera which also ended up without a geotag.

So it looks like not only does Camera fail to write out GPS EXIF tags in any sane fashion, it cracks the sads if Google snitching isn't fully enabled. What a crock of shit.

I think I'll install Open Camera on my own phone as well. It's just better. Thanks, trig.
posted by flabdablet at 9:01 AM on May 3


Response by poster: Just to wrap this up: I opened one of the photos I'd taken with Open Camera using Cx File Explorer's inbuilt viewer, and its Info button revealed GPS coordinates. So that's a more reliable way to test whether a photo has been geotagged than using Gallery, which is a lying liar that lies.
posted by flabdablet at 9:14 AM on May 3


> Are all the GPS/location settings for both the phone and the camera app definitely turned on? Apparently Android can get estimated location data via cell towers and so on, but doesn't necessarily treat that data in the same way as actual GPS coordinates

As an aside, this is how location services work on all phones, Android or not.

It's possible that people reading this post own a device that hasn't received location data from an actual GPS satellite in years, perhaps ever. Using Wifi SSIDs, Bluetooth, and cell phone network towers is fall cheaper energy-wise, so unless you are currently in a location with bad cell coverage and no WiFi hotspots (not just ones you are connected to, hotspots in general) you won't be talking to any GPS satellites.
posted by Back At It Again At Krispy Kreme at 10:04 AM on May 3


« Older Woodsy, beautiful getaway within driving distance...   |   Looking for tweet about militias and the beginning... Newer »

You are not logged in, either login or create an account to post comments