Giter Site home page Giter Site logo

Comments (19)

mlynch avatar mlynch commented on April 28, 2024 3

Ah good catch, we definitely should be keeping that exif data around.

from capacitor-plugins.

jarek104 avatar jarek104 commented on April 28, 2024 2

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

orzel095 avatar orzel095 commented on April 28, 2024 2

@mlynch, @gbresciano solution works for me, please add this commit to master,
I will be grateful, thanks and have good day 😁

from capacitor-plugins.

mlynch avatar mlynch commented on April 28, 2024 1

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.

mlynch avatar mlynch commented on April 28, 2024 1

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

mixuala avatar mixuala commented on April 28, 2024 1

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.

see: https://developer.apple.com/documentation/uikit/uiimagepickercontroller/infokey/1619147-mediametadata

apparently, you have to use PHAsset and PHPhotoLibrary to get the metadata from the images in the photo library

from capacitor-plugins.

gbresciano avatar gbresciano commented on April 28, 2024 1

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.

mlynch avatar mlynch commented on April 28, 2024

For our reference: https://www.startxlabs.com/post/preserving-and-updating-image-exif-data-in-ios/

from capacitor-plugins.

mlynch avatar mlynch commented on April 28, 2024

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.

jczaplew avatar jczaplew commented on April 28, 2024

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.

DavidWiesner avatar DavidWiesner commented on April 28, 2024

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.

jarek104 avatar jarek104 commented on April 28, 2024

Any updates on this?

from capacitor-plugins.

gbresciano avatar gbresciano commented on April 28, 2024

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

sebastianovide avatar sebastianovide commented on April 28, 2024

@jarek104 have you found a workaround until when it is merged in capacitor ?

from capacitor-plugins.

davidofwatkins avatar davidofwatkins commented on April 28, 2024

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.

jthoms1 avatar jthoms1 commented on April 28, 2024

@davidofwatkins Are your issues on Capacitor 2 or do they persist in Capacitor 3?

from capacitor-plugins.

davidofwatkins avatar davidofwatkins commented on April 28, 2024

@jthoms1 I have only tried this on Capacitor 3, unfortunately (iOS 14.5)

from capacitor-plugins.

dtarnawsky avatar dtarnawsky commented on April 28, 2024

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

ionitron-bot avatar ionitron-bot commented on April 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.