OSDN Git Service

説明文を追加.EXIF設定画面の変更
authorhayashi yuu <hayashi.yuu@gmail.com>
Mon, 10 Aug 2015 08:45:02 +0000 (17:45 +0900)
committerhayashi yuu <hayashi.yuu@gmail.com>
Mon, 10 Aug 2015 08:45:02 +0000 (17:45 +0900)
importPicture/src/osm/jp/gpx/ImportPicture.java

index afdf02b..2d9ec0f 100644 (file)
@@ -105,9 +105,10 @@ public class ImportPicture extends Thread {
 \r
         ImportPicture obj = new ImportPicture();\r
         obj.outDir = null;\r
+        obj.gpxDir = new File(".");\r
 \r
         if (argv.length > 0) {\r
-            obj.gpxDir = new File(argv[0]);\r
+            obj.imgDir = new File(argv[0]);\r
         }\r
 \r
         if (argv.length < 4) {\r
@@ -120,7 +121,7 @@ public class ImportPicture extends Thread {
         }\r
 \r
         // 基準時刻ファイルの「更新日時」を使って時刻合わせを行う。\r
-        File baseFile = new File(obj.gpxDir, argv[1]);\r
+        File baseFile = new File(obj.imgDir, argv[1]);\r
         jptime = new Date(baseFile.lastModified());\r
         String timeStr = argv[2];\r
         try {\r
@@ -162,6 +163,7 @@ public class ImportPicture extends Thread {
     }\r
     \r
     public File gpxDir = new File(".");\r
+    public File imgDir = new File(".");\r
     public File outDir = null;\r
     public long delta = 0;\r
     public boolean exif = false;\r
@@ -252,15 +254,18 @@ public class ImportPicture extends Thread {
                         }\r
                     }\r
 \r
+                    outDir = new File(gpxDir, imgDir.getName());\r
+                    outDir.mkdir();\r
                     System.out.println("           時差: "+ (delta / 1000) +"(sec)");\r
-                    System.out.println("    Target GPX: ["+ gpxFile.getName() +"]");\r
+                    System.out.println("    Target GPX: ["+ gpxFile.getAbsolutePath() +"]");\r
                     System.out.println("GPX start time: "+ dfjp.format(new Date(gpxStartTime)) + "\t[GMT " + dfuk.format(new Date(gpxStartTime))+"]");\r
                     System.out.println("  GPX end time: "+ dfjp.format(new Date(gpxEndTime)) + "\t[GMT " + dfuk.format(new Date(gpxEndTime))+"]");\r
+                    System.out.println("          EXIF: "+ (exif ? ("convert to '" + outDir.getAbsolutePath() +"'") : "off"));\r
                     System.out.println();\r
                     System.out.println("------------|--------------------|--------------------|------------|------------|--------|------|");\r
                     System.out.println(" name       | UpdateTime         | GPStime            | Latitude   | Longitude  | ele    |magvar|");\r
                     System.out.println("------------|--------------------|--------------------|------------|------------|--------|------|");\r
-                    proc(gpxDir, delta, gpxStartTime, gpxEndTime, map, exif, gpx);\r
+                    proc(imgDir, delta, gpxStartTime, gpxEndTime, map, exif, gpx);\r
                     System.out.println("------------|--------------------|--------------------|------------|------------|--------|------|");\r
                 }\r
 \r
@@ -328,14 +333,11 @@ public class ImportPicture extends Thread {
                                 }\r
                             }\r
 \r
-                            synchronized(System.out) {\r
-                                System.out.print(String.format("%12s|", image.getName()));\r
-                                System.out.print(String.format("%20s ", dfjp.format(itime)));\r
-                                System.out.print(String.format("%20s|", dfjp.format(uktime)));\r
-                                System.out.print(String.format("%12s %12s|", latStr, lonStr));\r
-                                System.out.println(String.format("%8s|%6s|", eleStr, magvarStr));\r
-                            }\r
-                            Thread.yield();                           \r
+                            System.out.print(String.format("%12s|", image.getName()));\r
+                            System.out.print(String.format("%20s ", dfjp.format(itime)));\r
+                            System.out.print(String.format("%20s|", dfjp.format(uktime)));\r
+                            System.out.print(String.format("%12s %12s|", latStr, lonStr));\r
+                            System.out.println(String.format("%8s|%6s|", eleStr, magvarStr));\r
 \r
                             if (exifWrite) {\r
                                 TiffOutputSet outputSet = null;\r
@@ -440,10 +442,6 @@ public class ImportPicture extends Thread {
 \r
                                 ExifRewriter rewriter = new ExifRewriter();\r
                                 try {\r
-                                    if (outDir == null) {\r
-                                        outDir = new File(dir, "converted");\r
-                                        outDir.mkdir();\r
-                                    }\r
                                     fos = new FileOutputStream(new File(outDir, imageName));\r
                                     rewriter.updateExifMetadataLossy(image, fos, outputSet);\r
                                 }\r