| This utility, exif_filename, is a powerful command-line tool designed for automatically renaming image files based on their embedded EXIF metadata. It streamlines the organization of digital photos by leveraging the capture date and optional geographical information directly from the images, providing a structured and informative naming convention. Why Use exif_filename?exif_filename offers significant advantages for anyone managing a large collection of digital photographs:
- Automated Organization: Eliminates the manual effort of renaming files, which is prone to human error and inconsistency.
- Chronological Sorting: Renames files with a date-time stamp (e.g.,
YYYY_MM_DD_HHhMMmSS), making it effortless to sort photos chronologically within any file explorer. - Geographical Context: Enhances filenames by integrating location data (City, State, Country) extracted from geotagged photos, providing immediate context about where a picture was taken without needing to open it.
- Batch Processing: Efficiently processes multiple image files in a specified directory, handling entire photo libraries with a single command.
- Standardized Naming: Ensures a consistent naming scheme across all your images, making future retrieval and management much simpler.
Technical Requirements and CompatibilityThis tool is designed for users comfortable with command-line interfaces and basic system operations. It requires some engineering skills to set up and utilize effectively. - Operating System Support:
- Dependencies: The tool relies on several external components to function correctly:
exiftool: A robust utility for reading, writing, and editing meta information in a wide variety of files.Python 3.6+: The scripting language environment for core logic.Geocoder library: A Python library used to convert geographical coordinates (latitude, longitude) from EXIF data into human-readable location names.
-
Runtime ExampleThe following example demonstrates how to use exif_filename to process a directory of images and the typical output you would expect. exif_filename.sh ~/Downloads/Photos-3-001
This command initiates the renaming process for all applicable image files within the ~/Downloads/Photos-3-001/ directory: [INFO] EXIF File Renaming Utility v1.0.0
[INFO] Target directory: /Users/chunkang/Downloads/Photos-3-001 2
[INFO] Force mode: true
[INFO] Checking dependencies...
[INFO] exiftool is available
[INFO] Python 3.6+ is available
[INFO] Geocoder library is available
[INFO] Processing files...
[OK] Renamed: 2026_01_07_21h31m38s_1.jpg -> 2026_01_07_21h31m38s.jpg
[OK] Renamed: 2026_01_07_20h29m24s_Irvine_California_US_1.jpg -> 2026_01_07_20h29m24s_Irvine_California_US.jpg
[OK] Renamed: 2026_01_07_21h26m52s_1.jpg -> 2026_01_07_21h26m52s.jpg
[OK] Renamed: 2026_01_07_21h26m48s_1.jpg -> 2026_01_07_21h26m48s.jpg
[OK] Renamed: 2026_01_07_20h29m10s_Irvine_California_US_1.jpg -> 2026_01_07_20h29m10s_Irvine_California_US.jpg
[OK] Renamed: 2026_01_17_22h40m50s_North_Tustin_California_US_1.jpg -> 2026_01_17_22h40m50s_North_Tustin_California_US.jpg
[OK] Renamed: 2026_01_07_20h36m16s_Irvine_California_US_1.jpg -> 2026_01_07_20h36m16s_Irvine_California_US.jpg
[OK] Renamed: 2026_01_07_20h37m50s_Irvine_California_US_1.jpg -> 2026_01_07_20h37m50s_Irvine_California_US.jpg
[OK] Renamed: 2026_01_07_20h20m33s_Irvine_California_US_1.jpg -> 2026_01_07_20h20m33s_Irvine_California_US.jpg
[OK] Renamed: 2026_01_07_21h26m20s_1.jpg -> 2026_01_07_21h26m20s.jpg
[OK] Renamed: 2026_01_07_21h26m30s_1.jpg -> 2026_01_07_21h26m30s.jpg
[OK] Renamed: 2026_01_17_22h21m50s_North_Tustin_California_US_1.jpg -> 2026_01_17_22h21m50s_North_Tustin_California_US.jpg
[OK] Renamed: 2026_01_17_22h22m02s_North_Tustin_California_US_1.jpg -> 2026_01_17_22h22m02s_North_Tustin_California_US.jpg
[OK] Renamed: 2026_01_07_21h26m45s_1.jpg -> 2026_01_07_21h26m45s.jpg
[OK] Renamed: 2026_01_07_20h38m33s_Irvine_California_US_1.jpg -> 2026_01_07_20h38m33s_Irvine_California_US.jpg
[OK] Renamed: 2026_01_07_20h36m12s_Irvine_California_US_1.jpg -> 2026_01_07_20h36m12s_Irvine_California_US.jpg
[OK] Renamed: 2026_01_17_22h22m37s_North_Tustin_California_US_1.jpg -> 2026_01_17_22h22m37s_North_Tustin_California_US.jpg
[OK] Renamed: 2026_01_07_21h31m19s_1.jpg -> 2026_01_07_21h31m19s.jpg
[OK] Renamed: 2026_01_07_21h26m12s_1.jpg -> 2026_01_07_21h26m12s.jpg
==========================================
Processing Summary
==========================================
Total files found: 19
Files renamed: 19
Files skipped: 0
Files failed: 0
==========================================
Output Breakdown: - Version and Target: Confirms the tool's version and the specific directory being processed.
- Force Mode: Indicates that the tool will proceed with renaming, potentially overwriting existing non-conflicting filenames.
- Dependency Check: Verifies that all necessary external tools and libraries (
exiftool, Python 3.6+, Geocoder) are installed and accessible, ensuring a smooth operation. - File Processing: Displays a real-time log of each file being renamed.
2026_01_07_21h31m38s.jpg: This format indicates a filename derived solely from the image's EXIF capture date and time (Year_Month_Day_HourhMinute_Second).2026_01_07_20h29m24s_Irvine_California_US.jpg: This format includes geographical information (City_State_Country) appended to the date-time stamp, indicating the photo was geotagged.
- Summary Report: Provides a comprehensive overview of the processing operation, detailing the total number of files discovered, how many were successfully renamed, and if any were skipped or failed. This gives a clear indication of the batch operation's success.
You can download it at https://github.com/chunkang/exif_filename/releases/tag/release%2Fv1.0.0 Tags: CLI EXIF Geo Code Geo Location Geographical Information exif_filename  |