Skip to content

Hawk-on/Picture-sorting

Repository files navigation

Picture Sorting Script

This PowerShell solution efficiently sorts large collections of pictures into a folder structure based on the "Date Taken" metadata. Available as both a command-line script and a user-friendly GUI application.

πŸ–₯️ User Interface Options

GUI Application (Recommended)

  • Modern WPF Interface: Easy-to-use graphical interface
  • Real-time Progress: Live progress bar and statistics
  • Interactive Logging: Comprehensive log window with color-coded messages
  • Folder Browser: Click to browse for source and destination folders
  • Test Mode: Preview operations without moving files
  • Configuration Panel: Adjust thread count and other settings

Command-Line Script

  • Automation-friendly: Perfect for scripts and batch operations
  • Parallel Processing: Uses PowerShell's ForEach-Object -Parallel for maximum efficiency
  • Flexible Parameters: Full control over all sorting options

Features

  • Parallel Processing: Uses all CPU cores for maximum efficiency
  • Metadata Extraction: Reads Date Taken from EXIF data using multiple methods
  • Smart Organization: Creates Year/Month folder structure (e.g., 2023/03-March/)
  • Unsorted Handling: Pictures without Date Taken or with dates before 1995 go to "Unsorted" folder
  • Duplicate Management: Automatically handles duplicate filenames by appending numbers
  • Test Run Support: Preview what will happen without actually moving files
  • Comprehensive Support: Handles various image formats (JPG, PNG, TIFF, HEIC, RAW, etc.)
  • Real-time Monitoring: Progress tracking and detailed logging

Requirements

  • PowerShell 5.1 or later (PowerShell 7.0+ recommended for command-line version)
  • Windows with .NET Framework
  • WPF support (standard on Windows, required for GUI)

Usage

πŸ–₯️ GUI Application (Easiest)

  1. Launch the GUI:

    .\Launch-PictureSorterGUI.ps1
  2. Configure settings in the interface:

    • Browse for source folder (containing your pictures)
    • Browse for destination folder (where sorted pictures will go)
    • Optionally enable "Test Run" to preview without moving files
    • Adjust thread count if needed
  3. Scan files to see how many pictures were found

  4. Start sorting and monitor progress in real-time

πŸ’» Command-Line Usage

Basic Usage

.\Sort-PicturesByDate.ps1 -SourcePath "C:\MyPictures" -DestinationPath "C:\SortedPictures"

Test Run (Preview)

.\Sort-PicturesByDate.ps1 -SourcePath "C:\MyPictures" -DestinationPath "C:\SortedPictures" -TestRun

Custom Thread Count

.\Sort-PicturesByDate.ps1 -SourcePath "C:\MyPictures" -DestinationPath "C:\SortedPictures" -ThrottleLimit 8

Using the Example Script

.\Example-Usage.ps1

πŸ“ Files in This Package

  1. Launch-PictureSorterGUI.ps1 - Main launcher for the GUI application ⭐
  2. PictureSorterGUI.ps1 - WPF-based graphical user interface
  3. Sort-PicturesByDate.ps1 - Core command-line sorting script
  4. Example-Usage.ps1 - Interactive command-line example
  5. README.md - This documentation file

Parameters

  • SourcePath: Source directory containing pictures to sort (required)
  • DestinationPath: Destination directory for organized pictures (required)
  • ThrottleLimit: Number of parallel threads (default: CPU core count)
  • SupportedExtensions: Array of file extensions to process
  • TestRun: Perform a dry run without moving files

Output Structure

SortedPictures/
β”œβ”€β”€ 2023/
β”‚   β”œβ”€β”€ 01-January/
β”‚   β”œβ”€β”€ 02-February/
β”‚   └── 03-March/
β”œβ”€β”€ 2024/
β”‚   β”œβ”€β”€ 06-June/
β”‚   └── 12-December/
└── Unsorted/
    β”œβ”€β”€ photo_without_date.jpg
    └── old_photo_1994.jpg

Performance

  • Optimized for hundreds of thousands of files
  • Uses all CPU cores by default
  • Minimal memory footprint with streaming processing
  • Typical performance: 100-500 files per second (depending on hardware and file sizes)

Safety Features

  • Test run mode for verification
  • Duplicate filename handling
  • Comprehensive error reporting
  • No modification of source files (only moves)

Supported Formats

JPG, JPEG, PNG, TIFF, TIF, BMP, GIF, HEIC, RAW, CR2, NEF, ARW

πŸš€ Quick Start

  1. Download/clone all files to a folder
  2. Right-click on Launch-PictureSorterGUI.ps1 β†’ "Run with PowerShell"
  3. Or open PowerShell in the folder and run: .\Launch-PictureSorterGUI.ps1
  4. Use the GUI to select folders and start sorting!

πŸ“„ Licensing

Picture Sorter uses a dual licensing model:

βœ… FREE for:

  • Individual users (personal use)
  • Non-profit organizations (501(c)(3) or equivalent)
  • Educational institutions (schools, universities, libraries)
  • Open source projects
  • Small businesses with annual revenue under $1,000,000 USD

πŸ’Ό Commercial License Required for:

  • Large companies with annual revenue over $1,000,000 USD
  • Government agencies and contractors
  • Commercial service providers using this software

Why dual licensing?

  • Keeps the software free for individuals and small organizations
  • Provides sustainable funding for continued development and support
  • Ensures priority support for commercial users

Need a commercial license? πŸ“§ Contact: licensing@picturesorter.com
🌐 Web: https://picturesorter.com/licensing

For detailed terms, see LICENSE.md and LICENSE-FREE.md

Troubleshooting

  1. Permission Errors: Run PowerShell as Administrator
  2. Execution Policy: Run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
  3. GUI Won't Load: Ensure .NET Framework and WPF are installed (standard on Windows)
  4. COM Errors: Restart PowerShell session if you encounter COM object errors
  5. Large Collections: For very large collections (1M+ files), consider processing in batches

About

No description, website, or topics provided.

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE.md
Unknown
LICENSE-FREE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors