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
EXIF Data Stripped From Images #45
Comments
Ah good catch, we definitely should be keeping that exif data around. |
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 |
Added exif output for camera photos to |
If the app has permissions for both geolocation and photos, will the geolocation exif data not be stripped from the image? |
@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. |
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 |
I'm looking for exif support on ios as well but it was empty for
apparently, you have to use PHAsset and PHPhotoLibrary to get the metadata from the images in the photo library |
Any updates on this? |
I made an amendment to include GPS and Orientation data in the "exit" property and also to add all the metadata to the resulting image so that the exit can be found in the jpeg file. This would solve issue #564
I modified Camera.swift to have GPS and Orientation data in the "exif" property and also in the result image's exif. |
@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? Thanks! |
@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. |
@mlynch, @gbresciano solution works for me, please add this commit to master, |
@jarek104 have you found a workaround until when it is merged in capacitor ? |
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. |
@davidofwatkins Are your issues on Capacitor 2 or do they persist in Capacitor 3? |
@jthoms1 I have only tried this on Capacitor 3, unfortunately (iOS 14.5) |
@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. |
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. |
When using the camera plugin on both Android and iOS most or all EXIF data is stripped from the image. On Android all attributes are stripped, and on iOS only
Orientation
,ExifIFDPointer
,ColorSpace
,PixelXDimension
andPixelYDimension
are returned.I could see this being handled in the following ways:
A) Return an EXIF dictionary with the image path
B) Retain the original EXIF data on the image itself
I think providing both is ideal, as A) would allow the client to use the EXIF data without needing to use a third-party library for using the EXIF data within the app. Additionally, B) allows for a direct upload for server-side parsing without needing to write the EXIF data back to the image client-side.
I am using the following code to test this:
I don't have experience writing Swift or Java, but if there is anything I can do to help implement this please let me know!
The text was updated successfully, but these errors were encountered: