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