Git Product home page Git Product logo

gopro_renamer's Introduction

GoPro Renamer

media-dater をベースにGoPro用のRenameに特化したPowerShellスクリプト;

動作環境

Windows PowerShell 5.1

※あらかじめスクリプトの実行が許可されていること

  1. 管理者権限でPowerShellを開く
  2. 以下のコマンドを実行
    • Set-ExecutionPolicy RemoteSigned
    • Unblock-File media_dater.ps1
  3. PowerShellを閉じる

対応ファイル

  • 拡張子がjpg/png/heicの画像ファイル
  • 拡張子がmov/mp4の動画ファイル

動作内容

  1. 現在のフォルダの下にある全ファイルのリストを取得する
    • サブフォルダに含まれるファイルも対象
  2. ファイル毎に日付情報を取得する
    • jpgファイルはExifを参照
    • heic/mov/mp4ファイルは詳細プロパティの「撮影日時」「メディアの作成日時」を参照
      (両方設定されている場合は「撮影日時」を優先する)
    • 上記処理で日時情報を取得できなかったファイルやpngファイルはファイル名を参照
      (YYYMMDD-HHMMSS*.拡張子 の形式であれば日付と見なす)
    • それでも取得できなかった場合はそのファイルはスキップ
  3. ファイル名を変更する
    • YYYYMMDD-HHMMSS-3桁連番.元の拡張子 とする
  4. ファイルの作成日時/更新日時を変更する
    • 撮影日時と同じとする

使い方

  1. media_dater.ps1 を適当な場所へ配置
  2. PowerShellを開く
  3. 画像/動画ファイルを含むフォルダへ移動
  4. media_dater.ps1 を実行

実行オプション

media_dater.ps1 [-d] [-r]

  • -d : 日時情報の取得とファイル名の候補表示(※)のみおこないます(dry-run)
  • -r : サブフォルダの下も処理対象とします(recursive)

※ファイル名の重複の検証を省略しているため、連番部分は"NNN"表示となります。

参考

gopro_renamer's People

Contributors

t-asano avatar ha1t avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.