How to Fetch the Geotag details of the captured image or stored image in Windows phone 8

后端 未结 4 956
说谎
说谎 2021-02-04 13:30

I want to fetch the information from the image regarding the Geolocation as shown in the image below

4条回答
  •  深忆病人
    2021-02-04 14:10

    In my PhotoTimeline wp8 app I use this ExifLib and the following code

    var info = ExifReader.ReadJpeg(stream, picture.Name);
    latitude = Utils.ConvertDegreeAngleToDouble(info.GpsLatitude[0], info.GpsLatitude[1], info.GpsLatitude[2], info.GpsLatitudeRef);
    longitude = Utils.ConvertDegreeAngleToDouble(info.GpsLongitude[0], info.GpsLongitude[1], info.GpsLongitude[2], info.GpsLongitudeRef);
    

    with the helper function defined as

    public static double ConvertDegreeAngleToDouble(double degrees, double minutes, double seconds, ExifGpsLatitudeRef   exifGpsLatitudeRef)
    {
        double result = ConvertDegreeAngleToDouble(degrees, minutes, seconds);
        if (exifGpsLatitudeRef == ExifGpsLatitudeRef.South)
        {
            result = -1*result;
        }
        return result;
    }               
    
    public static double ConvertDegreeAngleToDouble(double degrees, double minutes, double seconds)
    {            
        return degrees + (minutes/60) + (seconds/3600);
    }
    

提交回复
热议问题