Skip to content

Latest commit

Β 

History

History
72 lines (53 loc) Β· 2.63 KB

README.md

File metadata and controls

72 lines (53 loc) Β· 2.63 KB

img-sort

Introducing img-sort, a little golang tool that helps you keep your photos and videos organized. This tool will sort all your media in year and month folders, making it easy for you to find the photos and videos you need.

Features

  • Simple and easy to use with flags
  • Supports various file formats including JPEG, HEIC, MP4, MOV and more
  • Reads the exif data if available otherwise uses the modification time
  • Photos and videos without date or time information are moved to a directory unknown
  • Duplicates are handled by appending a postfix -1, -2, -3 and so on

Folder Structure

The folder structure created by img-sort will look like the following example:

β”œβ”€β”€ 2021
β”‚   β”œβ”€β”€ 2021-01
β”‚   β”‚   β”œβ”€β”€ 2021-01-07_11.23.44.jpg
β”‚   β”‚   β”œβ”€β”€ 2021-01-07_13.24.53.heic
β”‚   β”‚   β”œβ”€β”€ 2021-01-07_20.27.47.jpg
β”‚   β”‚   β”œβ”€β”€ 2021-01-07_20.27.47-1.jpg
β”‚   β”‚   β”œβ”€β”€ 2021-01-09_15.58.24.jpg
β”‚   β”‚   β”œβ”€β”€ 2021-01-09_21.39.27.mp4
β”‚   β”‚   β”œβ”€β”€ 2021-01-09_23.13.37.jpg
β”‚   β”‚   β”œβ”€β”€ 2021-01-14_10.44.50.mov
β”‚   β”œβ”€β”€ 2021-02
β”‚   |   β”œβ”€ ...
β”‚   β”œβ”€β”€ ...
β”‚   └── 2021-12
β”œβ”€β”€ 2022
β”‚   β”œβ”€β”€ 2022-01
β”‚   β”œβ”€β”€ 2022-02
β”‚   β”œβ”€β”€ ...
β”‚   └── 2022-12
β”œβ”€β”€ unknown
β”œβ”€β”€ ...

Installation

In order to use this application, the following dependencies must be installed on your system:

  • Perl: A version of Perl >= 5and < 6 must be installed.
  • Exiftool: A version of Exiftool >= 12.55 must also be installed on your system. This application searches for the binaries at /usr/bin/exiftool.

Please ensure that these dependencies are installed before attempting to run this application.

sudo apt-get install perl=5.30
sudo apt-get install exiftool=12.55

After all dependencies are installed download the executable of img-sort and add it to the $PATH variable or manually move it to /usr/bin/img-sort.

Usage

Simply run img-sort <source> <target> [flags]. The tool will take care of the rest.

img-sort /path/to/source /path/to/target

Available Flags

--dry / -d: Perform a dry run to test a command without modifying any data. --modtime / -m: If there is no date information available the file modification time can be used as a fallback.

Contribution

Img-sort is developed in Go. To build the binary, execute just go-build, which will generate the binary at ./build/img-sort. To publish a new version, use just release <patch|minor|major>. This command will automatically increment the version according to semantic versioning.