X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Fsave%2FExifSaver.java;h=d17c5d48fe4ca951ae58518b408c3724d7fbd5e5;hb=79f3ca2954d7feb6052c21b3aa974c89b2b101d6;hp=bc8d220c41ac7559f7695e107272bd04b71f49a1;hpb=140e9d165f85c3d4f0435a311e091209313faa2a;p=GpsPrune.git diff --git a/tim/prune/save/ExifSaver.java b/tim/prune/save/ExifSaver.java index bc8d220..d17c5d4 100644 --- a/tim/prune/save/ExifSaver.java +++ b/tim/prune/save/ExifSaver.java @@ -24,7 +24,6 @@ import tim.prune.ExternalTools; import tim.prune.I18nManager; import tim.prune.UpdateMessageBroker; import tim.prune.config.Config; -import tim.prune.data.Altitude; import tim.prune.data.Coordinate; import tim.prune.data.DataPoint; import tim.prune.data.Photo; @@ -244,7 +243,7 @@ public class ExifSaver implements Runnable { // Only look at photos which are selected and whose status has changed since load photo = entry.getPhoto(); - if (photo != null && photo.getOriginalStatus() != photo.getCurrentStatus()) + if (photo != null && photo.isModified()) { // Increment counter if save successful if (savePhoto(photo, overwriteFlag, false)) { @@ -266,20 +265,17 @@ public class ExifSaver implements Runnable } _progressBar.setVisible(false); // Show confirmation - UpdateMessageBroker.informSubscribers(I18nManager.getText("confirm.saveexif.ok1") + " " - + numSaved + " " + I18nManager.getText("confirm.saveexif.ok2")); + UpdateMessageBroker.informSubscribers(I18nManager.getTextWithNumber("confirm.saveexif.ok", numSaved)); if (numFailed > 0) { JOptionPane.showMessageDialog(_parentFrame, - I18nManager.getText("error.saveexif.failed1") + " " + numFailed + " " - + I18nManager.getText("error.saveexif.failed2"), + I18nManager.getTextWithNumber("error.saveexif.failed", numFailed), I18nManager.getText("dialog.saveexif.title"), JOptionPane.ERROR_MESSAGE); } if (numForced > 0) { JOptionPane.showMessageDialog(_parentFrame, - I18nManager.getText("error.saveexif.forced1") + " " + numForced + " " - + I18nManager.getText("error.saveexif.forced2"), + I18nManager.getTextWithNumber("error.saveexif.forced", numForced), I18nManager.getText("dialog.saveexif.title"), JOptionPane.WARNING_MESSAGE); } // close dialog, all finished @@ -296,6 +292,10 @@ public class ExifSaver implements Runnable */ private boolean savePhoto(Photo inPhoto, boolean inOverwriteFlag, boolean inForceFlag) { + // If photos don't have a file, then can't save them + if (inPhoto.getFile() == null) { + return false; + } // Check whether photo file still exists if (!inPhoto.getFile().exists()) { @@ -411,7 +411,7 @@ public class ExifSaver implements Runnable result[paramOffset + 3] = "-GPSLongitudeRef=" + inPoint.getLongitude().output(Coordinate.FORMAT_CARDINAL); // add altitude if it has it result[paramOffset + 4] = "-GPSAltitude=" - + (inPoint.hasAltitude()?inPoint.getAltitude().getValue(Altitude.Format.METRES):0); + + (inPoint.hasAltitude()?inPoint.getAltitude().getMetricValue():0); result[paramOffset + 5] = "-GPSAltitudeRef='Above Sea Level'"; // add the filename to modify result[paramOffset + 6] = inFile.getAbsolutePath();