In my last post, Markdown, I described the tools I'm using to publish to this blog. In particular, one of the key requirements of my choice of blogging platform was that I would be able to create posts directly from my iPhone or iPad. There are plenty of markdown creator apps in the app store, but the one I settled on, because of its ability to sync with Dropbox, was one called "Write".

The app lets the user insert images directly into the markdown, which is great, but images captured with the iPhone or iPad's camera tend to be huge. Rendering these uploaded images on the site looks terrible, because even though you can still scale them down with CSS, if they are very large, they tend to load onto the screen bit by bit, like in the days when you used to download images over your 2400 baud modem. Generally, you want images displayed on a web page to be more manageable like no wider than 600 or 900 pixels.

So, ideally, there needs to be a way to scale images to a lower resolution without having to download them first to make the change on the desktop. That would defeat the entire goal of blogging directly from your iDevice!

I looked through the app store and found several apps which would do this, but I was looking for one which uses the new "Photo Editing Extension" feature recently released with iOS7 ( or 8, not sure ). I checked a few of the existing apps which use the feature, like iCamera, and while those included the ability to crop an image, none offered the option to resize an image from within the Photos app.

Challenge accepted!

Creating a Photo Editing Extension turns out to be fairly easy. From XCode you can start a new project which sets you up with a template. This actually creates a second target for your project. The extension is, in effect, a separate app for which you need a separate certificate from the developer portal. When you submit the app you're effectively submitting a bundle of two apps together.

The rules for submitting an app indicated that the app part of the extension needed to "do something". That seemed like a bit of a roadblock, but it turns out that a simple instructional slideshow was acceptable to the review team when I did ultimately submit the app. In fact, the slideshow consisted of the the same three screenshots I used for the iTunes listing page.

I've had this post sitting in my drafts for more than a month now, and have, in the meantime, built and released the app to the app store:

Ever need to scale down an image for uploading to your blog?

In my next post, I'll describe how the app was built and include some code snippets.