# porg porg (Photo ORGanizer) is a command-line tool for renaming, organizing, and backing up photos to local and remote destinations. It uses EXIF data to rename files and organize them into year/month folders. It supports common photo formats like JPG, CR2, and CR3. ## Features - **Rename:** Renames photos based on their EXIF date and time data. - **Organize:** Organizes photos into year/month folder structure. - **Copy (Local & Remote):** Copies photos to local or remote destinations. - **EXIF Parsing:** Parses and displays EXIF data from photos. - **Configuration:** Supports a TOML configuration file for storing default settings. ## Installation ```bash cargo install porg ``` ## Requirements - **exiftool:** Must be installed on your system. See installation instructions at [https://exiftool.org/install.html](https://exiftool.org/install.html) - **SSH (for remote copy):** Required for copying to remote destinations. - **rsync (for local/remote copy):** Required for copying to local destinations. This should be installed by default on Mac/Linux. For Windows you'll probably need to use WSL or Cygwin. ## Usage porg offers several subcommands: ### 1. Rename Photos ```bash porg rename --source ~/photo-dump --recursive ``` - `--source`: Path to the directory containing the photos. - `--recursive`: (Optional) Process subdirectories recursively. ### 2. Organize Photos ```bash porg organize --source ~/photo-dump ``` - `--source`: Path to the directory containing the photos. ### 3. Copy Photos Locally ```bash porg copy-local --source ~/photo-dump --destination /Volumes/photos ``` - `--source`: Path to the directory containing the photos. - `--destination`: Path to the local destination directory. ### 4. Copy Photos Remotely ```bash porg copy-remote --source ~/photo-dump --destination user@123.456.789.123:~/photos ``` - `--source`: Path to the directory containing the photos. - `--destination`: Address of the remote server and destination path. Format: `user@server:/path/to/destination` ### 5. Parse EXIF Data ```bash porg parse --file /path/to/image.jpg ``` - `--file`: Path to the image file. ## Configuration porg can be configured using a TOML file. By default, it looks for `config.toml` in the following locations: - Current directory - `$HOME/.config/porg/config.toml` ### Sample Configuration ```toml supported_extensions = ["jpg", "JPG", "CR2", "CR3"] date_format = "%Y%m%d_%H%M%S" source = "/path/to/your/photos" remote_path = "user@remote-server:/path/to/backup" local_path = "/path/to/local/backup" logging_level = "info" ``` ### Configuration Options - `supported_extensions`: File extensions to process. - `date_format`: Date format for renaming files (using [strftime syntax](https://docs.rs/chrono/latest/chrono/format/strftime/index.html)). - `source`: Default source directory. - `remote_path`: Default remote destination path. - `local_path`: Default local destination path. - `logging_level`: Logging level ("info" or "debug"). ### Using a Custom Configuration File ```bash porg --config /path/to/your/config.toml [OPTIONS] ``` ## Contributing Contributions are welcome! Please submit a pull request. ## License MIT OR Apache-2.0