public Photo(File d,File f) throws IOException, NumberFormatException {
  ExtendedExifInterface exif=new ExtendedExifInterface(f.toString());
  String lonStr=exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE);
  if (lonStr == null) {
    throw new IOException("No EXIF tag");
  }
  float lonf=convertToDegree(lonStr);
  String lonRef=exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF);
  if (lonRef != null && !lonRef.equals("E")) {
    lonf=-lonf;
  }
  float latf=convertToDegree(exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE));
  String latRef=exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE_REF);
  if (latRef != null && !latRef.equals("N")) {
    latf=-latf;
  }
  lat=(int)(latf * 1E7d);
  lon=(int)(lonf * 1E7d);
  Log.d("Photo","lat: " + lat + " lon: "+ lon);
  ref=d.getAbsolutePath() + "/" + f.getName();
  String dir=exif.getAttribute(ExtendedExifInterface.TAG_GPS_IMG_DIRECTION);
  if (dir != null) {
    direction=(int)Double.parseDouble(dir);
    directionRef=exif.getAttribute(ExtendedExifInterface.TAG_GPS_IMG_DIRECTION_REF);
    Log.d("Photo","dir " + dir + " direction "+ direction+ " ref "+ directionRef);
  }
}

public Photo ( File d , File f ) throws IOException , NumberFormatException { ExtendedExifInterface exif = new ExtendedExifInterface ( f . toString ( ) ) ; String lonStr = exif . getAttribute ( ExifInterface . TAG_GPS_LONGITUDE ) ; if ( lonStr == null ) { throw new IOException ( "No EXIF tag" ) ; } float lonf = convertToDegree ( lonStr ) ; String lonRef = exif . getAttribute ( ExifInterface . TAG_GPS_LONGITUDE_REF ) ; if ( lonRef != null && ! lonRef . equals ( "E" ) ) { lonf = - lonf ; } float latf = convertToDegree ( exif . getAttribute ( ExifInterface . TAG_GPS_LATITUDE ) ) ; String latRef = exif . getAttribute ( ExifInterface . TAG_GPS_LATITUDE_REF ) ; if ( latRef != null && ! latRef . equals ( "N" ) ) { latf = - latf ; } lat = ( int ) ( latf * 1E7d ) ; lon = ( int ) ( lonf * 1E7d ) ; Log . d ( "Photo" , "lat: " + lat + " lon: " + lon ) ; ref = d . getAbsolutePath ( ) + "/" + f . getName ( ) ; String dir = exif . getAttribute ( ExtendedExifInterface . TAG_GPS_IMG_DIRECTION ) ; if ( dir != null ) { direction = ( int ) Double . parseDouble ( dir ) ; directionRef = exif . getAttribute ( ExtendedExifInterface . TAG_GPS_IMG_DIRECTION_REF ) ; Log . d ( "Photo" , "dir " + dir + " direction " + direction + " ref " + directionRef ) ; } }
create a bug from an osb gpx xml wpt element .
