Metadata setter (XMP) in CGImageMetadata API fails to set GPS hemisphere (coordinates OK).

Originator:raphael
Number:rdar://19690389 Date Originated:02-Feb-2015 11:18 PM
Status:Open Resolved:
Product:iOS SDK Product Version:8.1.3
Classification:Serious Bug Reproducible:Always
 
The API that sets CGImageMetadata (output, XMP) from existing CGImage properties (input) accepts GPS dictionary values (numerical coordinates), but fails to store hemisphere (LongitudeRef / LatitudeRef, WE, NS) along with the numerical values, leaving those with default values (N, E).

API: CGImageMetadataSetValueMatchingImageProperty().

This means that an image with valid GPS coordinates in its properties (CGImageProperties) from, say, Cupertino (N, W), will incorrectly  generate a place somewhere between Beijing and Shanghai (N, E) if that API is used.

There is a workaround to actually set the value as a single string value (latString = "12,21.98S") instead of a dual value + string (12,3487 & "S") using this API:
CGImageMetadataSetValueMatchingImageProperty(mdata, kCGImagePropertyGPSDictionary, kCGImagePropertyGPSLatitude, EXCF(latString));

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!