Giter Club home page Giter Club logo

phorg's Introduction

phorg

NOTE: This is a "heavily" modified fork from xandkar/phorg.

NOTE: Version 1.0.0 does not indicate stability. I changed it from the initial 0.17.4 to emphasize INCOMPATIBILITY with the original phorg version!

Idempotent photo/video file organizer.

NOTE: Both status badges are still pointing to xandkar/phorg.

test status dependencies status

Overview

Given a <src> and <dst> directories:

  1. finds photo/video files in <src>
  2. fetches their Exif data
  3. computes their hash digests
  4. moves/copies them into <dst>/<year>/<original filename>[.<ext>] where:
    • date and time are extracted from Exif metadata, from whichever of the following tags is found first, tried in order:
      • DateTimeOriginal
      • DateTimeCreated
      • CreateDate
      • DateCreated
      • Datecreate
      • CreationDate
      • TrackCreateDate
  5. optionally, you can (manually) add semantically-named subdirectories underneath the <year> directory and (manually) move the media files into them, these subdirectories will then be preserved on subsequent reprocessings, i.e. when this <dst> is later used as <src>

Example

(note the semantic subdirectory in 2024)

$ phorg /mnt/usb-drive $dst move
$ cd $dst
$ tree .
.
├── 2023
│   ├── PXL_20230606_172719293.jpg
│   ├── PXL_20230730_164735244.jpg
│   └── PXL_20231011_121556478.mp4
└── 2024
    ├── PXL_20240723_092144500.MP.jpg
    ├── PXL_20240723_092512679.MP.jpg
    └── SomeSortedImages
        ├── PXL_20240722_175510147.MP.jpg
        └── PXL_20240722_180451574.MP.jpg

Install

  1. Ensure a Rust 1.75.0+ toolchain is installed: https://www.rust-lang.org/tools/install
  2. cargo install phorg
  3. Ensure ~/.cargo/bin/ is in your PATH
  4. phorg help

Dependencies

Hard

Only the Rust tools mentioned above, everything else will be handled by cargo.

Soft

exiftool, which is used as a fallback whenever we fail to extract the needed metadata ourselves. This fallback can be disabled via CLI.

Absence of exiftool in PATH will cause errors which will be logged, but will not disrupt execution and the files we could not read enough data about will just be skipped.

phorg's People

Contributors

xandkar avatar lorki97 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.