-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Android 14 - Exif not being returned from the camera #916
Comments
I have a suspicion that the Android OS has locked it down so the location permission can't be passed from the Cordova application to the camera. Can you confirm this is the case? |
Are you able to confirm if a particular image has location information in the exif by some other means? (Perhaps by pulling the image directly over ADB or over USB) Normally the geolocation information is provided only if the underlying camera plugin adds it when the image was captured. The camera application itself would need the geolocation permissions granted for it to do this. Images in the gallery could also come from any source that may or may not have added geolocation information. So if the image itself lacks the geolocation exif data, then naturally it won't be available in cordova either. When it comes to android changes, a good place to start is:
I haven't looked through them but if there are intended behaviour changes at the android SDK level, it should be noted in one of those links. |
Taking from the gallery I can confirm that when I copy the file locally from DCIM, the exif location information is present, but if I select the same picture from the gallery in the application the location information is not present when the camera launcher reads the EXIF. It is present on Android 11, but not Android 14. |
Reading more I believe it's due to this policy: |
https://support.google.com/googleplay/android-developer/thread/304805154?hl=en&sjid=13835760325836208891-EU
First step is true, we have both permissions. Not quite sure what the implications of the remaining steps are. |
This is a significant issue for our application. Photos are used by our users for two purposes, audit trail to prove the work they did in the field (before and after photos while time and location stamps), also for logging the condition which can be important for insurance claims, being able to prove it was taking at the location on the specific date is again important. We have photo watermarking capability which can cover this requirement, but we've always relied on being able to fall back on the exif metadata.
I was wondering if you were able to verify the issue, we're concerned about this loss of functionality and finding a fix is going to become important quickly. |
I believe this is how the iOS implementation kind of works, but it involves an additional level of complexity as it requires managing location state with another asynchronous process. I think it was necessary for iOS whereas Android, the underlying camera application typically handled it assuming the Camera application itself had the geolocation permissions. To make the geolocation permissions optional, iOS uses a preference, and when enabled it will request and use the geolocation APIs and add to the exif itself. Android could do the same thing, and use the same preference to enable the functionality. The core location API available in Android is not great to say the least, and documentation is sparse. They have a Google Play services API for geolocation instead, but making the camera plugin depend on that will likely be considered a breaking change. Before we get into that though, I would like to see why the EXIF attributes are not being returned in the first place, given you said that they are actually available if you pull directly from DCIM and inspect the metadata manually.
Cordova never implemented a custom camera, or uses the camera APIs directly. It always relied on using Intents, which is a way for one application to delegate camera tasks to another installed application (which the user may choose) and have the result be given back to the requesting application. It is possible that the installed Camera application being used just doesn't use geolocation or set the location EXIF attributes anymore when capturing photos. But I think you've cleared that possibility in this case by stating:
If the underlying image contains the EXIF attributes, then at least sourcing that same image by picking from the gallery
Is it possible that your watermarking tool is messing with EXIF attributes? Are you able to reproduce the issue in a Sample Reproduction app? If so then that sample project can be shared which will help serve as a test case.
I have not and I haven't had an opportunity to try to replicate the issue either. To be frank my volunteer time is better spent elsewhere to solve the problems with using I'm sharing knowledge in hopes that it can provide enough assistance for you/your company to find the root cause and potential solutions, especially since at the moment you have a reproduction case available to test against. And if you do find the cause and solution, then it would be nice (but not required to) send a pull request back to the Camera plugin under the Apache 2.0 license. If your company forbids it, then your company will likely require to fork and maintain their own version of the camera plugin instead of relying on open source contributions, especially if a fix for this feature is mission critical for your app. |
Bug Report
Problem
What is expected to happen?
Exif data is returned - including geolocation
What does actually happen?
On Android 11 it works fine.
On Android 14, geolocation EXIF information is missing.
Information
Command or Code
Environment, Platform, Device
Galaxy Tab A for Android 11.
Galaxy Tab A9 for Android 14.
Version information
Cordova-Android : 13.0.0
Cordova-Camera_Plugin: 7.0.0
Checklist
The text was updated successfully, but these errors were encountered: