OSDN Git Service

GUIのパネルボタンの配置を変更 Java8
authorhayashi <hayashi.yuu@gmail.com>
Mon, 17 Sep 2018 06:12:25 +0000 (15:12 +0900)
committerhayashi <hayashi.yuu@gmail.com>
Mon, 17 Sep 2018 06:12:25 +0000 (15:12 +0900)
importPicture/nbproject/project.properties
importPicture/src/README.jp.txt
importPicture/src/osm/jp/gpx/matchtime/gui/AdjustTime.java

index e1213a9..f3a5b38 100644 (file)
@@ -1,28 +1,19 @@
-application.title=AdjustTime2
-application.vendor=yuu
-endorsed.classpath=
-#Sun Oct 08 23:44:30 JST 2017
+#Mon Sep 17 14:44:31 JST 2018
 excludes=
-file.reference.commons-compress-1.14.jar=commons-compress-1.14.jar
-file.reference.commons-imaging-1.0-20170205.201009-115.jar=lib/commons-imaging-1.0-20170205.201009-115.jar
 javac.deprecation=false
 build.test.results.dir=${build.dir}/test/results
-run.classpath=\
-    ${javac.classpath}:\
-    ${build.classes.dir}
-javadoc.nonavbar=false
 javac.external.vm=true
-run.test.classpath=\
-    ${javac.test.classpath}:\
-    ${build.test.classes.dir}
+run.classpath=${javac.classpath}\:${build.classes.dir}
+javadoc.nonavbar=false
+run.test.classpath=${javac.test.classpath}\:${build.test.classes.dir}
 annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
-javac.processorpath=\
-    ${javac.classpath}
+javac.processorpath=${javac.classpath}
 javac.target=1.8
 file.reference.importPicture-src=src
 annotation.processing.processors.list=
 javadoc.noindex=false
 javadoc.additionalparam=
+file.reference.commons-imaging-1.0-20170205.201009-115.jar=lib/commons-imaging-1.0-20170205.201009-115.jar
 includes=**
 build.classes.dir=${build.dir}/classes
 source.encoding=UTF-8
@@ -45,28 +36,25 @@ build.classes.excludes=**/*.java,**/*.form
 javadoc.splitindex=true
 javadoc.encoding=${source.encoding}
 javac.source=1.8
-junit.selected.version=4
+application.vendor=yuu
+junit.selected.version=3
 debug.classpath=${run.classpath}
-run.jvmargs=-Duser.language=en\n-Duser.country=US
+run.jvmargs=-Duser.language\=en\n-Duser.country\=US
 build.generated.dir=${build.dir}/generated
 jar.compress=false
-javac.test.classpath=\
-    ${javac.classpath}:\
-    ${build.classes.dir}:\
-    ${libs.junit.classpath}:\
-    ${libs.junit_4.classpath}:\
-    ${libs.hamcrest.classpath}
+javac.test.classpath=${javac.classpath}\:${build.classes.dir}\:\:${libs.junit_4.classpath}\:${libs.hamcrest.classpath}
 javadoc.private=false
 annotation.processing.run.all.processors=true
+file.reference.commons-compress-1.14.jar=commons-compress-1.14.jar
+application.title=AdjustTime2
 meta.inf.dir=${src.dir}/META-INF
 manifest.file=manifest.mf
 annotation.processing.enabled=true
 dist.javadoc.dir=${dist.dir}/javadoc
 src.dir=${file.reference.importPicture-src}
+endorsed.classpath=
 mkdist.disabled=false
-javac.classpath=\
-    ${file.reference.commons-imaging-1.0-20170205.201009-115.jar}:\
-    ${file.reference.commons-compress-1.14.jar}
+javac.classpath=${file.reference.commons-imaging-1.0-20170205.201009-115.jar}\:${file.reference.commons-compress-1.14.jar}
 annotation.processing.enabled.in.editor=false
 build.generated.sources.dir=${build.dir}/generated-sources
 javadoc.version=false
index c5ea196..2749310 100644 (file)
@@ -56,6 +56,50 @@ EXIFへの書き込みには別途「Apache commons imaging」ライブラリが
 commons_imaging ライブラリは下記から入手してください。
 (version 1.0 以降が必要です)
 
+-------------------------------------------------------------------
+
+[Restamp]
+
+動画から一定間隔で切り出したIMAGEのファイル更新日時を書き換える
+
+ ・画像ファイルの更新日付を書き換えます。(Exi情報は無視します)
+    ※ 指定されたディレクトリ内のすべての'*.jpg'ファイルを処理の対象とします
+
+ ・画像は連番形式(名前順に並べられること)の名称となっていること
+
+ ・一定の間隔(等間隔)で撮影された画像ファイルの中から2つの画像の撮影時刻を
+  入力することで、2つの画像の間の画像数から撮影間隔を割り出し、時刻を指定され
+  ていない残りの画像も含めて、画像ファイルの「ファイル更新日時」を書き換えます。
+## パラメータ
+ ・対象のフォルダ(ディレクトリ内のすべての'*.jpg'ファイルを処理の対象とします)
+ ・基準となる画像(2つ)
+ ・基準画像の正しい日時(2つ)
+
+> java -cp .:AdjustTime2.jar osm.jp.gpx.Restamp <imgDir> <baseFile A> <baseTime A> <baseFile B> <baseTime B>
+
+ argv[0] = 画像ファイルが格納されているディレクトリ                --> imgDir
+ argv[1] = 時刻補正の基準とする画像ファイル                    --> baseFile A
+ argv[2] = 基準画像ファイルの精確な撮影日時 "yyyy-MM-dd_HH:mm:ss" --> baseTime A
+ argv[3] = 時刻補正の基準とする画像ファイル                    --> baseFile B
+ argv[4] = 基準画像ファイルの精確な撮影日時 "yyyy-MM-dd_HH:mm:ss" --> baseTime B
+
+## 使い方 
+ 1. 予め、動画から画像を切り出す
+   ソースファイル(mp4ファイル); 「-i 20160427_104154.mp4」
+     出力先: 「-f image2 img/%06d.jpg」 imgフォルダに6桁の連番ファイルを差出力する
+   切り出し開始秒数→ 「-ss 0」 (ファイルの0秒から切り出し開始)
+   切り出し間隔; 「-r 30」 (1秒間隔=30fps間隔)
+ ```
+ $ cd /home/yuu/Desktop/OSM/20180325_横浜新道
+ $ ffmpeg -ss 0  -i 20160427_104154.mp4 -f image2 -r 15 img/%06d.jpg
+ ```
+ 2. ファイルの更新日付を書き換える
+ ```
+ $ cd /home/yuu/Desktop/workspace/AdjustTime/importPicture/dist
+ $ java -cp .:AdjustTime2.jar osm.jp.gpx.Restamp /home/yuu/Desktop/OSM/20180325_横浜新道/img 000033.jpg 2018-03-25_12:20:32 003600.jpg  2018-03-25_13:20:09
+ ```
 
 
 -------------------------------------------------------------------
index 195f9e1..5ab17fd 100644 (file)
@@ -23,7 +23,7 @@ import org.apache.commons.imaging.formats.tiff.constants.ExifTagConstants;
 public class AdjustTime extends JFrame
 {
     public static final String PROGRAM_NAME = "AdjustTime for JOSM";
-    public static final String PROGRAM_VARSION = "8.01";
+    public static final String PROGRAM_VARSION = "4.01";
     public static final String PROGRAM_UPDATE = "2018/09/17";
 
     AppParameters params;
@@ -63,6 +63,7 @@ public class AdjustTime extends JFrame
     JButton openButton;                // [Fit]ボタン
     JButton zoomInButton;      // [Zoom in]ボタン
     JButton zoomOutButton;     // [Zoom out]ボタン
+    
     JButton nextButton;     // [次へ]ボタン
     JButton backButton;     // [戻る]ボタン
     JButton doButton;       // [処理実行]ボタン
@@ -158,21 +159,40 @@ public class AdjustTime extends JFrame
         // INIT_CONTROLS
         Container container = getContentPane();
         container.setLayout(new BorderLayout());
-        setSize(getInsets().left + getInsets().right + 960,getInsets().top + getInsets().bottom + 480);
+        setSize(
+            getInsets().left + getInsets().right + 720,
+            getInsets().top + getInsets().bottom + 480
+        );
         setTitle(AdjustTime.PROGRAM_NAME +" v"+ AdjustTime.PROGRAM_VARSION);
         
+        //---- CENTER -----
+        JPanel mainPanel = new JPanel();
+        mainPanel.setLayout(new BorderLayout());
+        container.add(mainPanel, BorderLayout.CENTER);
+        
+        //---- SOUTH -----
+        JPanel southPanel = new JPanel(new BorderLayout());
+        southPanel.add(Box.createVerticalStrut(10), BorderLayout.SOUTH);
+        southPanel.add(Box.createVerticalStrut(10), BorderLayout.NORTH);
+        container.add(southPanel, BorderLayout.SOUTH);
+        
+        //---- SPACE -----
+        container.add(Box.createVerticalStrut(30), BorderLayout.NORTH);
+        container.add(Box.createHorizontalStrut(10), BorderLayout.WEST);
+        container.add(Box.createHorizontalStrut(10), BorderLayout.EAST);
+        
         params = new AppParameters();
         
         //---------------------------------------------------------------------
         cardPanel = new JPanel();
         cardPanel.setLayout(new CardLayout());
-        container.add(cardPanel, BorderLayout.CENTER);
+        mainPanel.add(cardPanel, BorderLayout.CENTER);
         
         nextButton = new JButton(i18n.getString("button.next"));
-        container.add(nextButton, BorderLayout.EAST);
+        southPanel.add(nextButton, BorderLayout.EAST);
 
         backButton = new JButton(i18n.getString("button.previous"));
-        container.add(backButton, BorderLayout.WEST);
+        southPanel.add(backButton, BorderLayout.WEST);
 
         cards = new JPanel[5];
         for (int i=0; i < 5; i++) {
@@ -222,12 +242,12 @@ public class AdjustTime extends JFrame
         argsPanel.add(exifBase);
         argsPanel.add(fupdateBase);
         if (params.getProperty(AppParameters.GPX_BASETIME).equals("EXIF_TIME")) {
-               fupdateBase.setSelected(false);
-               exifBase.setSelected(true);
+            fupdateBase.setSelected(false);
+            exifBase.setSelected(true);
         }
         else {
-               fupdateBase.setSelected(true);
-               exifBase.setSelected(false);
+            fupdateBase.setSelected(true);
+            exifBase.setSelected(false);
         }
         cards[cardNo].add(argsPanel, BorderLayout.CENTER);