Upload Image to WordPress Workflow

Upload Image (v1.1): A minor update to my image uploading Workflow. The workflow now checks to see how wide the image is and automatically resizes it to a width of 2048px, if necessary.

Most of the images I publish here are screenshots from iOS devices. In those instances, I prefer to keep the image in its original resolution. But there are rare occasions when I’d like to upload much higher resolution images taken with my iPhone’s camera or my Canon PowerShot G9 X. This is why I’ve decided to implement a Resize Image action into my Upload Image (v1.1) workflow.

If you’re interested in learning more about this workflow, links to the original version and my initial write-up explaining the thought process behind it will remain below.

—June 12, 2016

 

My obsession with Workflow has quickly become a quest to overhaul my publishing setup. I’ve already shared workflows for composing links and publishing in WordPress — both of which have undergone significant changes over the past few weeks, I plan on sharing them soon. But now it’s time to work on a less-frequently initiated task — uploading images to Initial Charge’s WordPress media library.

If you’ve been reading the site for any length of time, you’ve probably noticed that I use images sparingly. The bulk of my publishing activity consists of Linked List items, which never include images, but even the weekly feature articles only contain images a handful of times each year.

Upload images to WordPress with Workflow

However, this recent series I’ve been writing about Workflow has really benefited from visual aids. It’s often difficult to grasp what a workflow is doing unless you can see it with you’re own eyes. As such, there’s been a sharp increase in the number of images I’ve been uploading to my server.

Before my recent efforts to go iOS-first in everything I do, the images I published on Initial Charge would get run through ImageOptim and uploaded from the WordPress dashboard. This wasn’t exactly the most elegant solution — I’m sure I could have hacked together something that was a bit more streamlined — but it worked. Unfortunately though, there doesn’t seem to be an app for iOS that’s designed to take an image and output a compressed version for online publishing.

My first attempt at building a new system for publishing images was to use Kraken.io in place of ImageOptim and continue uploading from the WordPress dashboard. The biggest problem with this solution is that it was incredibly tedious, especially if I was working with several images. I would end up with multiple copies of each image in my camera roll — often resulting in the wrong copy being uploaded to my server. And the process required loading multiple webpages across two different sites. I needed something better.

Of course, the solution had been staring me in the face the whole time. I was writing about Workflow and uploading screenshots of Workflow, why hadn’t I tried to solve the problem with Workflow?

The Workflow

My first draft of Upload Image used the Resize Image action to shrink the size of my images. But to my dismay, the resulting image quality was far too low to use on the site. That’s when I began to investigate the Kraken.io API to see if I could use it from within Workflow. This endeavor was short lived. Without the addition of other applications — like Pythonista — there just wasn’t any way to do it.

The solution came to me when I was browsing Workflow’s available actions on my iPad — Convert Image. I could convert my screenshots to JPEG and adjust the quality slider until Workflow output images at small file sizes without sacrificing image quality. As it turns out, Workflow’s default setting for image quality was actually quite good and didn’t require any tweaking. Perhaps I’ll change it in the future, but for now it does just fine as is.

Initiating Upload Image workflow.

I typically initiate Upload Image from the action sheet within Photos or LongScreen, but it should work in any application that supports action extensions. When run, the workflow performs the following:

  • Workflow asks you to rename the image.
  • The Replace Text action is used to replace any spaces in the name with dashes and all capitalized letters are changed to lowercase.
  • The image is converted to JPEG at about 80% quality.
  • The resulting file’s name is changed and it is uploaded using the Post to WordPress action.
  • Workflow assembles the file’s URL using the current date and the file’s name.
  • An alert appears noting that the image’s URL has been copied to the clipboard.

From there, the URL can be pasted into your text editor of choice for publishing. I’m a big fan of Ulysses, but I can understand if you’ve fallen for another app, there’s plenty of good ones available.

The workflow doesn’t do anything too fancy. It doesn’t combine multiple iPhone screenshots into a single image and it doesn’t clean up the menu bar. Many of the workflows I’ve seen that perform a similar function do, but I didn’t want any of that. If I want to combine multiple images, I can do so in LongScreen. And personally, I hate when writers clean their device’s menu bar. It feels too sterile, as if the device never gets used. I get a kick out of seeing the carrier flag and how low their battery charge is.

There are a few things to remember before you start using this workflow:

  • Make sure to change the URL towards the bottom to your WordPress installation’s location.
  • Upload Image doesn’t support multiple images at once and I have no idea what would happen if you tried to run it that way. It’s possible I could add support for this in the future, but for now I’ll keep it simple.
  • The workflow assumes that you have “Organize my uploads into month- and year-based folders” turned on in WordPress’ media settings.

This is by no means a complicated workflow. But it is one of my favorite to date. I love how quick and streamlined it is — just activate, give the image a name, and the URL is copied to your clipboard. It’s that simple. No need to worry about using dashes instead of spaces or properly capitalizing the image’s file name, the workflow takes care of that for you.

Naming the image and URL copied to clipboard.

An earlier build of Upload Image launched the WordPress dashboard in Safari when it completed. This way I could fill in the title and alt text inside of WordPress’ media library, but it was eventually scrapped. Historically, I’ve always filled in this information, but I don’t really know why. It doesn’t seem to get used unless you’re inserting images from the WordPress dashboard — which I don’t use anymore. It could be added with two simple actions, though, a Text action with your media library’s URL and an Open URLs action.

I’ve written a lot about Workflow and Ulysses lately. They’ve helped me completely overhaul my publishing system and have become two of my favorite iOS apps of all time. Of the two, though, Workflow has made the largest impact on the way I use iOS.

Not only am I using it to streamline my writing and publishing, I’m also using it to upload images to Instagram, initiate searches of Initial Charge, and to notify my wife of when I’ll be home. There’s never been an app that’s so quickly made its way into this many areas of my life. It’s fun to tinker with and makes me feel like a genius when I find that one action that brings a workflow together. I’ve heard it from many prominent writers that work this beat, but it’s even more true than I could have imagined, Workflow is absolutely incredible. If you’re not using it, you should be.