Comments (19)
Ah good catch, we definitely should be keeping that exif data around.
from capacitor-plugins.
@mlynch, if @gbresciano found a solution, is there any chance we could add this fix? This limitation is essentially stopping me from switching to ionic.
from capacitor-plugins.
@mlynch, @gbresciano solution works for me, please add this commit to master,
I will be grateful, thanks and have good day 😁
from capacitor-plugins.
So, one thing here, each platform strips geolocation info from the image if taken from the camera. That makes sense to me, otherwise it'd be a way to skirt geolocation permissions. The app should do its own geolocation checking and associate with the taken image.
However, the rest of the exif is definitely there in the info passed to us, so we can/should provide it back.
Need to look into getting full exif from photo in album, which should include geolocation I'd think
from capacitor-plugins.
@jczaplew not sure on that, seems to work for Android but iOS strips it. Need to do more research.
42f03909fbbcb95cfa817905680b3edb989aaff4 adds EXIF support to Android, both for camera and gallery photos.
Only thing remaining is exif for iOS camera roll photos.
from capacitor-plugins.
I'm looking for exif support on ios as well but it was empty for resultType=CameraResultType.Uri
. Not a swift expert, but I came across this:
This key is valid only when using an image picker whose source type is set to UIImagePickerController.SourceType.camera, and applies only to still images.
The value for this key is an NSDictionary object that contains the metadata of the photo that was just captured. To store the metadata along with the image in the Camera Roll, use the PHAssetChangeRequest class from the Photos framework.
apparently, you have to use PHAsset and PHPhotoLibrary to get the metadata from the images in the photo library
from capacitor-plugins.
I modified Camera.swift to have GPS and Orientation data in the "exif" property and also in the result image's exif.
from capacitor-plugins.
For our reference: https://www.startxlabs.com/post/preserving-and-updating-image-exif-data-in-ios/
from capacitor-plugins.
Added exif output for camera photos to Camera.getPhoto
. Data returned in an exif
field as a dictionary. Todo: android camera, ios/android photo library
from capacitor-plugins.
So, one thing here, each platform strips geolocation info from the image if taken from the camera. That makes sense to me, otherwise it'd be a way to skirt geolocation permissions. The app should do its own geolocation checking and associate with the taken image.
If the app has permissions for both geolocation and photos, will the geolocation exif data not be stripped from the image?
from capacitor-plugins.
I would like to have an implementation where the exif data will be put again in the new image. But keep in mind that some values of the exif data will be changed in the process e.g.: orientation, image width and image height
from capacitor-plugins.
Any updates on this?
from capacitor-plugins.
@mlynch I've never used git before, and I don't understand how this works 😅
I made some changes to Camera.swift that sorted this out for me. Can you have a look?
gbresciano/capacitor@6334c1e
Thanks!
from capacitor-plugins.
@jarek104 have you found a workaround until when it is merged in capacitor ?
from capacitor-plugins.
Was this meant to be closed? I see this has been fixed on Android above, but I'm still not able to get GPS EXIF data when taking a photo on iOS.
Unfortunately the plugin has changed significantly since the workaround posted above, and I lack the Swift/iOS knowledge to apply it to the latest version.
from capacitor-plugins.
@davidofwatkins Are your issues on Capacitor 2 or do they persist in Capacitor 3?
from capacitor-plugins.
@jthoms1 I have only tried this on Capacitor 3, unfortunately (iOS 14.5)
from capacitor-plugins.
@davidofwatkins GPS EXIF data is not captured when accessing the Camera plugin. This is because the camera plugin does not obtain the location of the device. To capture location information you will need to do this yourself by adding the geolocation plugin, capturing the current location (before or after capturing the photo) then using this along with the image captured.
Note that the Camera app in iOS and Android both request geolocation permissions and capture location information and will include it in the EXIF of photos that are saved. This is why you see this data in photos you have selected from the photo library.
This particular issue on Cap 2 and 3 was causing all the other EXIF data to not save.
If you would like more detailed information on this it is worth looking at this repo:
https://github.com/dtarnawsky/capacitor-exif-test
from capacitor-plugins.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.
from capacitor-plugins.
Related Issues (20)
- bug: Calling the Haptics.vibrate method too often hangs iOS HOT 1
- Add Label on marker on ionic capacitor plugin HOT 1
- [google-maps] remote marker shows default marker on IOS when marker not yet loaded HOT 1
- GoogleMap 'Missing or invalid map id' HOT 3
- Capacitor camera editing for gallery images returns original image HOT 3
- [Camera] All photos are available when picking even though only some photos are allowed to access HOT 2
- [Google Maps] App crashing on startup when plugin is installed HOT 4
- @capacitor/camera Photos permission ignored HOT 2
- Catching if neither buttons in Dialog was clicked HOT 3
- capacitor/camera plugin if we go back to the Home Screen and tap again our app icon in Home Screen it is not showing the camera screen HOT 2
- Google Map not showing on IOS if the html element has border HOT 5
- Feature request to add custom headers in capacitor/browser
- Camera is able to get Photos from File System Applications (Google Drive, Files)
- Use @capacitor/share to share img from capacitor-screenshot HOT 2
- Performance issues when attaching files to app HOT 1
- Geolocation does not work on Electron app HOT 2
- plugin dependency issue on androidx.emoji2:emoji2-views-helper:1.4.0 HOT 7
- bug: [iOS] CameraPlugin.presentCameraPicker Crashes Application HOT 6
- Android crashing: java.lang.ClassCastException: com.capacitorjs.plugins.localnotifications.NotificationStorage.getSavedNotifications
- Keep notification visible until user interact
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capacitor-plugins.