Changeset 9329 in josm


Ignore:
Timestamp:
2016-01-06T17:30:31+01:00 (8 years ago)
Author:
Don-vip
Message:

fix #12255 - fix EXIF time parsing regression

Location:
trunk
Files:
5 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java

    r9277 r9329  
    1212import java.util.TimeZone;
    1313
     14import org.openstreetmap.josm.Main;
     15import org.openstreetmap.josm.data.SystemOfMeasurement;
     16import org.openstreetmap.josm.data.coor.CachedLatLon;
     17import org.openstreetmap.josm.data.coor.LatLon;
     18import org.openstreetmap.josm.tools.ExifReader;
     19
    1420import com.drew.imaging.jpeg.JpegMetadataReader;
    1521import com.drew.lang.CompoundException;
     
    1925import com.drew.metadata.exif.ExifIFD0Directory;
    2026import com.drew.metadata.exif.GpsDirectory;
    21 import org.openstreetmap.josm.Main;
    22 import org.openstreetmap.josm.data.SystemOfMeasurement;
    23 import org.openstreetmap.josm.data.coor.CachedLatLon;
    24 import org.openstreetmap.josm.data.coor.LatLon;
    25 import org.openstreetmap.josm.tools.ExifReader;
    2627
    2728/**
     
    432433     *
    433434     * If successful, fills in the LatLon, speed, elevation, image direction, and other attributes
     435     * @since 9270
    434436     */
    435437    public void extractExif() {
     
    448450            dirGps = metadata.getFirstDirectoryOfType(GpsDirectory.class);
    449451        } catch (CompoundException | IOException p) {
     452            Main.warn(p);
    450453            setExifCoor(null);
    451454            setPos(null);
     
    459462            }
    460463        } catch (MetadataException ex) {
    461             Main.debug(ex.getMessage());
     464            if (Main.isDebugEnabled()) {
     465                Main.debug(ex.getMessage());
     466            }
     467        }
     468
     469        // Changed to silently cope with no time info in exif. One case
     470        // of person having time that couldn't be parsed, but valid GPS info
     471        try {
     472            setExifTime(ExifReader.readTime(file));
     473        } catch (ParseException ex) {
     474            setExifTime(null);
    462475        }
    463476
     
    481494            setSpeed(speed);
    482495        } catch (Exception ex) {
    483             Main.debug(ex.getMessage());
     496            if (Main.isDebugEnabled()) {
     497                Main.debug(ex.getMessage());
     498            }
    484499        }
    485500
     
    492507            setElevation(ele);
    493508        } catch (MetadataException ex) {
    494             Main.debug(ex.getMessage());
     509            if (Main.isDebugEnabled()) {
     510                Main.debug(ex.getMessage());
     511            }
    495512        }
    496513
     
    512529            }
    513530        } catch (Exception ex) { // (CompoundException and other exceptions, e.g. #5271)
    514             Main.debug(ex.getMessage());
    515         }
    516 
    517         // Changed to silently cope with no time info in exif. One case
    518         // of person having time that couldn't be parsed, but valid GPS info
    519         try {
    520             setExifTime(ExifReader.readTime(file));
    521         } catch (ParseException ex) {
    522             setExifTime(null);
     531            if (Main.isDebugEnabled()) {
     532                Main.debug(ex.getMessage());
     533            }
    523534        }
    524535
Note: See TracChangeset for help on using the changeset viewer.