PHAsset Location — GPS MetaData, what's wrong?
trying to add location from a UIImage using Phasset:
// image is a variable like so: image: UIImage var newAsset = PHAssetChangeRequest.creationRequestForAssetFromImage(image) newAsset.location = CLLocation(latitude: coordinate.latitude, coordinate.longitude)
this code works, apparently -> save a new asset into the photo library with the good coordinate. I can see it in the library itself.
but when I use exif tools and similar, most of the time, GPS dictionnary is empty as if location was not set.
(also, I noticed GPS info is not in exif format)
so I guess, location information is also somewhere else…
so what’s wrong with location property of PHAsset ?
how can set properly location ?
Solutions Collect From Internet About “PHAsset Location — GPS MetaData, what's wrong?”
Photos tracks location metadata it its own database, separately from the EXIF metadata stored in each photo file. When you (as a client of the Photos API) or the user creates/adds a new asset, Photos reads the EXIF location data from the file and sets the location in its database to match. Beyond that, however, the Photos API makes no effort to keep these in sync.
If you want to update the EXIF metadata in the file, you’ll need to do that yourself. (Image I/O can help with that — see this answer.) Then, add the whole file, not just a
UIImage created from it, to Photos using
creationRequestForAssetFromImageAtFileURL: or the new
PHAssetCreationRequest stuff in iOS 9.
- How to programmatically use iOS voice synthesizers? (text to speech)
- How can I retain a local variable that is set in a block?
- xcode code sense color/completion not working
- What are the differences between nil, NULL and ?
- Keypath <transientproperty> not found in entity
- How to measure true FPS performance of OpenGL ES?
- How can I change the Dock preferences programmatically?
- importing a project into a remote SVN server in XCode 5
- iPhone Linker Error (AudioStreamer)
- Eclipse GDB MacOSX Mavericks
- Swift 2 protocol extension not calling overridden method correctly
- Extract part of URL
- Creating an Array From a CSV File Using Objective C
- How to check if a text field is empty or not in swift
- snapshotViewAfterScreenUpdates glitch on iOS 8