X-Git-Url: https://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Fsave%2FExifSaver.java;h=3c1a7b814f605777054862d04632f3123ed05794;hb=7f5ed2be62905bd37717376dc22d09e5ea7edb4d;hp=986a07ee3052eaa33e3d5ad6e2626f93ca282d34;hpb=1ee49ae3c8ef3aa2e63eadd458531e5f8bd4f92c;p=GpsPrune.git diff --git a/tim/prune/save/ExifSaver.java b/tim/prune/save/ExifSaver.java index 986a07e..3c1a7b8 100644 --- a/tim/prune/save/ExifSaver.java +++ b/tim/prune/save/ExifSaver.java @@ -8,6 +8,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; +import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JCheckBox; @@ -23,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; @@ -129,7 +129,10 @@ public class ExifSaver implements Runnable { JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); - panel.add(new JLabel(I18nManager.getText("dialog.saveexif.intro")), BorderLayout.NORTH); + // Label at top + JLabel topLabel = new JLabel(I18nManager.getText("dialog.saveexif.intro")); + topLabel.setBorder(BorderFactory.createEmptyBorder(8, 6, 5, 6)); + panel.add(topLabel, BorderLayout.NORTH); // centre panel with most controls JPanel centrePanel = new JPanel(); centrePanel.setLayout(new BorderLayout()); @@ -240,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)) { @@ -292,6 +295,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()) { @@ -407,7 +414,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();