How I Organise My Photos

I’m a sucker for cloud storage.

I have unlimited storage in Google Drive and I put everything up there in the clouds. Files that consume most of my Google Drive space (more than 1 TB as of now) are photos. I take LOTS of photos. I store the RAW files from my camera in Google Drive too.

I’m a bit obsessed about how my photos are organised too, sadly.

Currently, I’m using both Dropbox and Google Drive to organise my photos. I use Dropbox to upload the photos from my phone automatically. I use Dropbox because it converts the filenames to a format I like, unlike Google Photos (which retains the original filename). However, I still upload my photos–albeit being in ‘High Quality’ size–to Google Photos because it has so many awesome features.

Because I only have 16 GB of Dropbox space, I regularly move the photos to my Google Drive. Not only being in the right cloud, I also want my photos to be organised in such way it’s easy for me to find (and reminisce about) them. So here’s how I do it.

Uploading

For camera photos from my phone and tablet, I use Dropbox’s Camera Upload feature to upload the camera results to Dropbox using WiFi. The photos will then be downloaded to my computer using the Dropbox desktop app.

For DSLR photos, I upload them directly from my computer to Google Drive using Insync.

For other types of photos, I either upload them directly from my computer, or use BitTorrent Sync to upload them from my phone/tablet to my computer (and subsequently be uploaded to Google Drive).

Organising

Here’s the best part.

With a little magic from my programming knowledge I automatically organise all of my photos collection. One thing: I like the filename format provided by Dropbox:

/20[0-9]{2}-[0-9]{2}-[0-9]{2} [0-9]{2}.[0-9]{2}.[0-9]{2}/

It basically names the photo based on its creation date. For example: “2016-07-24 01.28.25.jpg“. So, I want all my photos to be named in that format. Aside from being in that format, I also want them to be organised in directories based on the year and month. So the photo with the filename previously mentioned would be placed in “$SOME_DIR/2016/07“.

Photos from phone/tablet are automatically named as such. However, they’re uploaded to Dropbox! So I created a Ruby script (which runs on my local machine) to move them to the destination directory (which syncs to Google Drive).

require 'fileutils'

def move_file(new_dir, new_file, f)
  unless File.exist?(new_file)
    FileUtils.mkdir_p(new_dir)
    FileUtils.mv(f, new_file)
  end
end

fn = Dir.new("/home/araishikeiwai/$DROPBOX_CAMERA_UPLOADS")
FileUtils.cd(fn)
fn.each do |f|
  if File.file?(f)
    year = f[0..3]
    month = f[5..6]
    new_dir = "/home/araishikeiwai/$GOOGLE_DRIVE_CAMERA_DIR/#{year}/#{month}/"
    new_file = new_dir + f
    move_file(new_dir, new_file, f)
  end
end

I run the script every two hours using Cron. This way, I always have them organised by year and month on Google Drive. Further, if there are certain events, I move the photos for that events and put them in a directory in root photo directory, based on the structure:

$ROOT_PHOTO_DIR/$YEAR/%YY%MM%DD %EVENT_NAME

For DSLR photos, I don’t always convert them all to JPG. Most of the photos from my DSLR camera are RAW. I only convert what I need to share or post on Instagram/500px/Facebook. I use Darktable for my post-processing needs and set up the export filename format as above. And when there are many photos from certain events, I follow the rule above.

Other photos from phone apps, such as Instagram, I created a script to automatically move them and rename them to the same format.

One interesting thing to note is screenshots. I organise all my screenshots in one directory. So the screenshots from my computer (taken using Shutter), phone (QuickMemo+), and tablet (standard iOS screenshot) are all moved and renamed (following the same format, of course) into the same directory. Again, based on year and month.

This seems tedious, with heavy use of internet (downloading from Dropbox and uploading back to Google Drive) and only works when my computer is running (although my computer is almost always running). I tried creating a Google Apps Script to download the photos from Dropbox and upload them directly to Google Drive (bypassing my local computer), however there’s a 10 MB limit on file size, which can be a problem when I have videos to be moved. I’ll create another post on how I utilise Google Apps Script and Dropbox API to migrate files automatically between them.

Leave a Reply

Your email address will not be published. Required fields are marked *