moon indicating dark mode
sun indicating light mode

A golang photo organizer

April 23, 2020

Github repo

A small program written in Golang to recursively organize your photo library by copying and sorting photos by year and month from a source to a dest folder. This is my first attempt at the go language. Feel free to improve it through pull requests!

Media files supported

.tiff .tif .gif .jpeg .jpg .png .raw .webm .mkv .avi .mov .wmv .mp4 .m4v .mpg .mp2 .mpeg


go get
go build photosort.go


./photosort [srcFolder] [destFolder]

Important: This has only been tested on Windows 10, let me know how it behaves in other OS.


  • Recursively visits all files and folders in the srcFolder directoy tree
  • Analyses Exif data and copies to the necessary folder structure by year and month (creating folders if needed)
  • Skips duplicated files and non-media files

Example folder structure, this:

│ image1.jpg
│ image2.jpg
│ │ image1.jpg
│ │ video1.png
│ │
│ └───subfolder1
│ │ image4.jpg
│ │ image5.jpg
│ │ image6.jpg
│ │ file112.txt
│ file021.txt
│ image5.png

Becomes this:

│ └───1
│ │ image1.jpg
│ │ video1.png
│ └───1
│ │ image4.jpg
│ │ image2.jpg
│ │
│ └───3
│ │ image6.jpg
│ image5.png


I’m Pedro, a Solutions Architect @ AWS 🇵🇹🇪🇺🌍

I love good books, papers, hiking and photography.

Talk to me about distributed systems and cloud architecture.

You can reach me on twitter.