Ticket #24005: 0001-fix-missing-direction-on-last-image.patch

File 0001-fix-missing-direction-on-last-image.patch, 1.1 KB (added by StephaneP, 19 months ago)
  • src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java

    diff --git a/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java b/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java
    index 023c495be..1750d76d0 100644
    a b public final class GpxImageCorrelation {  
    269269                    if (nextWp != null && dirpos.isSetImageDirection()) {
    270270                        double direction = curWp.bearing(nextWp);
    271271                        curTmp.setExifImgDir(computeDirection(direction, dirpos.getImageDirectionAngleOffset()));
     272                    } else if (nextWp == null && isLast && dirpos.isSetImageDirection()) {
     273                        //last image in the sequence without any next waypoint-> get previous direction angle
     274                        double direction = prevWp.bearing(curWp);
     275                        curTmp.setExifImgDir(computeDirection(direction, dirpos.getImageDirectionAngleOffset()));
    272276                    }
    273277                    curTmp.setGpsTime(curImg.getExifInstant().minusMillis(offset));
    274278                    curTmp.flagNewGpsData();