Ticket #11162: josm-0-metadata-extractor272.patch

File josm-0-metadata-extractor272.patch, 3.8 KB (added by anonymous, 7 years ago)
  • src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java

    diff -Nru josm-0/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java josm-0.metadata-extractor2.7.2/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
    old new  
    614614        }
    615615
    616616        try {
    617             double speed = dirGps.getDouble(GpsDirectory.TAG_GPS_SPEED);
    618             String speedRef = dirGps.getString(GpsDirectory.TAG_GPS_SPEED_REF);
     617            double speed = dirGps.getDouble(GpsDirectory.TAG_SPEED);
     618            String speedRef = dirGps.getString(GpsDirectory.TAG_SPEED_REF);
    619619            if (speedRef != null) {
    620620                if (speedRef.equalsIgnoreCase("M")) {
    621621                    // miles per hour
     
    632632        }
    633633
    634634        try {
    635             double ele = dirGps.getDouble(GpsDirectory.TAG_GPS_ALTITUDE);
    636             int d = dirGps.getInt(GpsDirectory.TAG_GPS_ALTITUDE_REF);
     635            double ele = dirGps.getDouble(GpsDirectory.TAG_ALTITUDE);
     636            int d = dirGps.getInt(GpsDirectory.TAG_ALTITUDE_REF);
    637637            if (d == 1) {
    638638                ele *= -1;
    639639            }
     
    666666        // 1) GPS_TIME_STAMP not set -> date/time will be null
    667667        // 2) GPS_DATE_STAMP not set -> use EXIF date or set to default
    668668        // 3) GPS_TIME_STAMP and GPS_DATE_STAMP are set
    669         int[] timeStampComps = dirGps.getIntArray(GpsDirectory.TAG_GPS_TIME_STAMP);
     669        int[] timeStampComps = dirGps.getIntArray(GpsDirectory.TAG_TIME_STAMP);
    670670        if (timeStampComps != null) {
    671671            int gpsHour = timeStampComps[0];
    672672            int gpsMin = timeStampComps[1];
     
    675675
    676676            // We have the time. Next step is to check if the GPS date stamp is set.
    677677            // dirGps.getString() always succeeds, but the return value might be null.
    678             String dateStampStr = dirGps.getString(GpsDirectory.TAG_GPS_DATE_STAMP);
     678            String dateStampStr = dirGps.getString(GpsDirectory.TAG_DATE_STAMP);
    679679            if (dateStampStr != null && dateStampStr.matches("^\\d+:\\d+:\\d+$")) {
    680680                String[] dateStampComps = dateStampStr.split(":");
    681681                cal.set(Calendar.YEAR, Integer.parseInt(dateStampComps[0]));
  • src/org/openstreetmap/josm/tools/ExifReader.java

    diff -Nru josm-0/src/org/openstreetmap/josm/tools/ExifReader.java josm-0.metadata-extractor2.7.2/src/org/openstreetmap/josm/tools/ExifReader.java
    old new  
    124124     */
    125125    public static LatLon readLatLon(GpsDirectory dirGps) throws MetadataException {
    126126        if (dirGps != null) {
    127             double lat = readAxis(dirGps, GpsDirectory.TAG_GPS_LATITUDE, GpsDirectory.TAG_GPS_LATITUDE_REF, 'S');
    128             double lon = readAxis(dirGps, GpsDirectory.TAG_GPS_LONGITUDE, GpsDirectory.TAG_GPS_LONGITUDE_REF, 'W');
     127            double lat = readAxis(dirGps, GpsDirectory.TAG_LATITUDE, GpsDirectory.TAG_LATITUDE_REF, 'S');
     128            double lon = readAxis(dirGps, GpsDirectory.TAG_LONGITUDE, GpsDirectory.TAG_LONGITUDE_REF, 'W');
    129129            return new LatLon(lat, lon);
    130130        }
    131131        return null;
     
    158158     */
    159159    public static Double readDirection(GpsDirectory dirGps) {
    160160        if (dirGps != null) {
    161             Rational direction = dirGps.getRational(GpsDirectory.TAG_GPS_IMG_DIRECTION);
     161            Rational direction = dirGps.getRational(GpsDirectory.TAG_IMG_DIRECTION);
    162162            if (direction != null) {
    163163                return direction.doubleValue();
    164164            }