Why do I do this to myself?

August 1, 2025

It took a few weeks, but I got the photos from my Peru trip into their own photo gallery. It wasn't bad this time around, but the whole process is a bit of a slog. And the sad thing is, I can't think of any way to automate any more of it away. Here's what I subject myself to every time I go on vacation:

Take lots of pictures. OK, this part is kind of fun because it's the part when I'm actually on vacation. In Peru I took 709 pictures, plus one that one my friends took of me standing next to a statue.

Import them from my phone. On Windows 7 this involved walking across the room and plugging the phone into the computer, or using an SD card dongle on the phone and transferring the contents of the card. Like a savage. Since Windows 10 there's an Android app called "Link to Windows"; on Linux there's KDEConnect. Get the phone on the same wifi network as the computer, do some setup, and then it's all done from the couch. The photos all go into a temporary folder on the desktop.

Caption all the images. This part is the first one that takes a long time: writing captions for all the pictures. I dump a directory listing to a text file, and write something for each image. Even if what I write is just "this one is shit", "same as previous", "accidental sidewalk picture". These are for me when I look at them later on, so I try to put in as much as I can. While I'm doing this I also copy any pictures of other people that I took of them, and put them into their own folders to give to them when I'm done.

Copy the images to permanent storage. The desktop folder is temporary like I said, so the images get copied to their permanent folders in ~/Pictures. I organize by date and subject/location, so the folders get names like 2025-06-17a Aguas Calientes. I also copy the relevant parts of the captions list into each folder.

Winnow down the temp folder. This part takes almost as long as the captioning. This is where I delete the photos I'm not putting online. Repeats, photos of other people, ones where I didn't mean to take the picture at all, and pictures that were just plain boring out of context. I try to cut at least half the images, 2/3 if I can, removing the captions from the master list too. For the Peru trip I wound up with 231 pictures when I was done -- having cut slightly more than 2/3 of the original 709.

Resize the images. On Windows I used a Photoshop macro. On Linux I use a shell script that hooks into ImageMagick. The full-sized images (4032x3024) need to be reduced to 1/4 size (1008x756), and the thumbnails to 1/28 size (144x108).

Upload to Google Drive. This part is relatively straightforward -- create folders on Google Drive and mass-upload the resized images. The main thing I need to remember is that I have to set the permissions on those folders to global. From there I use a plugin I found to create a CSV file of filenames and URLs. Those files need a quick edit because you need a different URL format depending on whether you're embedding the file (like for the thumbnails) or viewing it on its own (like the 1MP images).

Merge the files. Another shell script takes the captions file and merges it with the two CSV files for the thumbnail and main image URLs. This usually takes a few tries as I replace tabs with spaces and find images I deleted from the temp folder but left captions for. In the end I wind up with a file that looks like this for each image:

20250612_071830.jpg
Image: https://drive.google.com/file/d/1pU0ogOE6ze6ixAN7aM3aPkvmRB1vvA4I/view
Thumb: https://lh3.googleusercontent.com/d/16BIqFpLAxDuNf7IGv5RrYM-jvs2b_1QS
A statue near the lobby of the hotel. I can't find anything about it online.

Copy-paste it all into the database. I have an admin piece on the site that I create the photo album URLs and sections in, once those are made I paste each photo's information into it to create the display you see. This is about the only thing I could see being automatable: I could probably use more shell scripting to create a giant wad of INSERT statements that would dump everything into the database at once. All I'd need to do would be to add the section ID to each one. But that seems like kind of a pain too, when you're dealing with a couple hundred statements.

So, there it is. This is why it takes weeks instead of days to get my vacation pictures up.

July 25, 2025August 8, 2025