objective c - iOS location data in UIImage metadata isn't handling negative CGFloat/double -


After making some difficult efforts, please send me your UIImage EXIF ​​using the CLLocationManager Found GPS data injection. It was really a terrible experience, I personally do not recommend it.

I am using the code below to write an image in the property's library, and the metadata's log output of my NSDictionary ([5] .key printing details: {GPS} [5] Print details of: Price: {Height = "-1.606232"; Latitude = "49.86973495227272"; Latitude Ref = N; Geometry = "-125.1198035572889"; Underline RF = W;}

Here The save method is:

  - (zero) saveToCameraRoll {NSUserDefaults * defaults = [NSUserDefaults StandardUserDefaults]; // Capture that 'Metadata' var NSDictionary * Metadata = [default (_ImageMetadata); From this next line, NSDictionary fraction;; (_imageToSave) {ALAssetsLibrary * Library = [Elassette Library New]; [Library List Image ToSwit Photo Album: [_Vitotes Save CImme] Metadata: Metadata CompletionBank: ^ (NSDLL * Esset url, nsERR * error) {if (error) {// darran, bad things happened} else {// navigator!}}];}}  

and location status update rep Method:

  - (zero) Location Manager: (CLLocationManager *) Probe Tinker Update: Location (CLLocation *) newLocation fromLocation: (CLLocation *) Old location {CGFloat currentLatitude = [Manager location] .coordinate.latitude; CGFloat current transaction = [manager location] .coordinate.longitude; CGFloat currentAltitude = [Manager's location] .altitude; // If for GPS (! _ Location location) _locationData = [NSMutableDictionary dictionary]; [_locationData Set Value: [NSNumber NumberWind: DoubleDoll: Current Latitude] KA: (NSSTING * KCGIMMGPPTGPS Lititid]; [_locationData setValue: For [NSNL Numberalist Repeat: Current Legacy]: (nssting *) KCGIMJPProptGPS Lingitude]; NSSTING * REF; If (Current Latitude & lt; 0.0) referee = @ "S"; Other ref = @ "n"; [_locationData setValue: Ref: Key: (NSString *) kCGImagePropertyGPSLatitudeRef]; If (current number & lt; 0.0) referee = @ "W"; Other ref = @ "e"; [_locationData setValue: Key for Ref: (NSString *) KCGImage PropertyGPS Linktindorf]; [_locationData setValue: for [NSNumber Number: Flight: Onset Altitude]: (NSSTING * KCGIMMGPPTGS Altapter]; }  

So all is fine, and I look at the saved photo: Latitude and all this is good, but then I look at longitude, and this is 0 is.

My guess is that? It is not liked anywhere that longitude is a negative number. I do not know much about geo-coordinates, but perhaps you do, and do you want to help me out of the English Channel?

Hooja!

Because I was declaring S and W referee value, I stuck to the point that the way to deal with the XIG GPS data may require full values.

The solution was instead of using the raw float value, I used the fibers () to get the full float value.

  ... [_locationData set value: [repeat number of NSN repeats: FAs (current latitude)] KA: (NSSTING * KCGImagePropertyGPS Letitad]; [_locationData setValue: [NSNumber number repeating: for fibs (current ambiguity)] KA: (nssting *) KCGimagePropertyGPS Lingitude]; ...  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -