]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/save/ExifSaver.java
Version 8, September 2009
[GpsPrune.git] / tim / prune / save / ExifSaver.java
index a5ae40295054d5eace532c3a542c53d99d510f07..f8e04de67a5a1308ca6d5706ed0f3ab505de1fec 100644 (file)
@@ -19,6 +19,7 @@ import javax.swing.JProgressBar;
 import javax.swing.JScrollPane;
 import javax.swing.JTable;
 
+import tim.prune.Config;
 import tim.prune.ExternalTools;
 import tim.prune.I18nManager;
 import tim.prune.UpdateMessageBroker;
@@ -27,7 +28,6 @@ import tim.prune.data.Coordinate;
 import tim.prune.data.DataPoint;
 import tim.prune.data.Photo;
 import tim.prune.data.PhotoList;
-import tim.prune.data.PhotoStatus;
 
 /**
  * Class to call Exiftool to save coordinate information in jpg files
@@ -80,7 +80,7 @@ public class ExifSaver implements Runnable
        public boolean saveExifInformation(PhotoList inPhotoList)
        {
                // Check if external exif tool can be called
-               boolean exifToolInstalled = ExternalTools.isExiftoolInstalled();
+               boolean exifToolInstalled = ExternalTools.isToolInstalled(ExternalTools.TOOL_EXIFTOOL);
                if (!exifToolInstalled)
                {
                        // show warning
@@ -115,7 +115,7 @@ public class ExifSaver implements Runnable
                _dialog.pack();
                // set progress bar and show dialog
                _progressBar.setVisible(false);
-               _dialog.show();
+               _dialog.setVisible(true);
                return true;
        }
 
@@ -291,7 +291,7 @@ public class ExifSaver implements Runnable
                        }
                }
                String[] command = null;
-               if (inPhoto.getCurrentStatus() == PhotoStatus.NOT_CONNECTED)
+               if (inPhoto.getCurrentStatus() == Photo.Status.NOT_CONNECTED)
                {
                        // Photo is no longer connected, so delete gps tags
                        command = getDeleteGpsExifTagsCommand(inPhoto.getFile(), inOverwriteFlag);
@@ -332,7 +332,7 @@ public class ExifSaver implements Runnable
        {
                // Make a string array to construct the command and its parameters
                String[] result = new String[inOverwrite?5:4];
-               result[0] = "exiftool";
+               result[0] = Config.getConfigString(Config.KEY_EXIFTOOL_PATH);
                result[1] = "-P";
                if (inOverwrite) {result[2] = " -overwrite_original_in_place";}
                // remove all gps tags
@@ -354,7 +354,7 @@ public class ExifSaver implements Runnable
        {
                // Make a string array to construct the command and its parameters
                String[] result = new String[inOverwrite?10:9];
-               result[0] = "exiftool";
+               result[0] = Config.getConfigString(Config.KEY_EXIFTOOL_PATH);
                result[1] = "-P";
                if (inOverwrite) {result[2] = "-overwrite_original_in_place";}
                int paramOffset = inOverwrite?3:2;
@@ -369,7 +369,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().getValue(Altitude.Format.METRES):0);
                result[paramOffset + 5] = "-GPSAltitudeRef='Above Sea Level'";
                // add the filename to modify
                result[paramOffset + 6] = inFile.getAbsolutePath();