schussman.com logo

Sync Lightroom Galleries to Android - Automatically!

Now that I have a photogenic, tiny gurgling creature in the house, I’m shooting a lot of photos, both on the Droid X and the Pentax. Most of these photos end up, one way or another, in Lightroom for cataloguing, and as I’ve described earlier, I have a nice workflow for updating these rapidly-growing galleries on my iPad.

But how about the Droid X? It has a nice screen, and I want to foist photos of my beautiful boy on anyone I happen across — so I started to wonder if, continuing to use Lightroom as my core platform, I could keep a small gallery of photos on the Android phone with as little manual work as possible.

Here’s the executive summary: I again use a smart published collection in Lightroom to create the gallery; then I use a LaunchAgent in OS X to monitor the mount point of the Droid X on the filesystem; and a tiny shell script syncs the published gallery to the Droid whenever I plug it into the MacBook Pro. Read on for altogether too many details.

First, a couple of things to note about how the Droid X generates image galleries [ note that this may apply to all Android devices; I have no idea, and your mileage may vary ]:

  • Android automatically displays galleries based on image type — so you don’t need to update a database or anything to build your galleries on the phone. You just need folder(s) full of images.
  • When you run the Gallery app, it will display galleries with the name of the parent folder containing the images. This means you can make a folder tree on the Droid’s SD card and neatly package multiple gallery folders within it, without cluttering up your root directory.

Prepare the SD card

When I attach my Droid X via USB to the MacBook Pro, it automatically mounts it as a volume titled NO NAME, so I used the Finder to change the label to DROIDX. This, happily, seems not to have affected any of the phone’s operations; the Droid must not depend on the name of the SD card for any of its internal work.

The second preparation step is to create a master gallery directory on the SD card. This is just for housekeeping purposes; everything in the galleries will be in a subdirectory of that top-level directory. Again, I simply did this with the finder: navigate to the DROIDX drive when the phone is connected, and create a new top-level directory, Galleries.

Your SD card and Droid should now be ready to go.

Set up the Gallery/Galleries

Just like last time, I’m using smart publish collections, based on keywords, to populate the galleries that will be synced. I decided to prefix all the keywords for this usage with dx — so, dx-gallery is my main tag, and I’ve edited it in LR to not be included in export. It’s a housekeeping tag only.

I’ve tagged a bunch of images with the dx-gallery tag.

Then it’s off to build the publish service. Here’s what it looks like in the publishing manager:

And add to that service a Published Smart Set that looks like this:

You can assign multiple keywords to the Smart Set, or create as many smart sets as you want galleries, and use unique keywords to assign photos to each. Each smart set within the published collection will appear in your directory tree as a subdirectory of the top-level folder for the set — and that makes the syncing to the Droid easy.

Automate syncing via LaunchAgent

Everything I know about LaunchAgent I learned from this tutorial. This is basically a concise repeating of that description, edited for our purposes. (I’ve previously described using this process to perform system backups)

First, if it’s not already there, mkdir ~/Library/LaunchAgents. This is the folder that OS X will watch for scripts triggered by system events such as mounting an external drive, which is exactly what plugging in the Droid does.

In that directory, make a new plist file (I called mine droid-sync-watch.plist) and give paste this into it:

<?xml version=1.0 encoding=UTF-8?> <!DOCTYPE plist PUBLIC “-//Apple Computer//DTD PLIST 1.0//EN” \ “http://www.apple.com/DTDs/PropertyList-1.0.dtd”> <dict> <key>Label</key> <string>droid-sync</string> <key>LowPriorityIO</key> <true/> <key>Program</key> <string>/Users/alan/Library/Scripts/droid-sync</string> <key>ProgramArguments</key> <array> <string>droid-sync</string> </array> <key>WatchPaths</key> <array> <string>/Volumes</string> </array> </dict> </plist>

In short, this plist file tells the OS to run the identified script (~Library/Scripts/droid-sync) when the specified WatchPath changes.

The sync script itself lives in ~Library/Scrips and consists of a check against the desired volume (here’s where naming the Droid SD card comes in) and an rsync of the designated published collection to the previously-generated target directory on the SD card.

#!/bin/bash # delay a short time to make sure the path is available echo -n "[*]-- new /Volumes... sleeping" | logger sleep 20 if [ ! -e "/Volumes/DROIDX" ]; then       echo -n "[*]-- DROIDX NOT connected - Exiting" | logger       exit 0    else       echo -n "[*]-- DROIDX Connected - Performing gallery sync" | logger fi # rsync with delete option rsync --delete -r ~/Pictures/Exported\ Photos/Droid/ /Volumes/DROIDX/Galleries echo -n "[*]-- DROIDX gallery sync complete" | logger

Finally, tell the LaunchAgent controller to watch your scripts by doing the following at a terminal:

  • launchctl load ~/Library/LaunchAgents
  • launchctl list | grep sync

You should see your droid-sync script appear in the list produced by the second command, above.

Now you’re ready!

Plug in and go

That really should do it. When you connect the Droid X, you can watch the messages in the sync script appear in your console log, and everything should work — after syncing, disconnect the device again and fire up the gallery application; in the “Folders” section of the gallery you should see an item for each gallery you create in Lightroom. You’re done!

As with the iPad workflow, the great part of this is that once it’s set up, it’s pretty automatic. If you edit, add, or remove photos, as long as you republish the collection, those changes will all be pushed over to the Droid. Thanks to a little nerdery and Lightroom, we’ve built a bit of functionality that the Droid software doesn’t directly offer — and it’s still done with LR as the core of the photo library.

Lightroom 2 Raw Development: Exposure

Last time in my ongoing ramblings on Lightroom 2 raw workflow, I focused on white balance. Today we move along a bit further with some elements of exposure.

A note about workflow seems pertinent: Lightroom’s preset abilities are pretty extensive, but I don’t make a whole lot of use of them, particularly for raw development (Though I do have lots of metadata presets that I apply at import to apply information about location). The develop presets make the most sense to me for repeated, reliable situations: Shooting in a studio, for example, where you know combinations of lens and light and in which case the effort to tune and save those presets will be rewarded. That’s my experience so far, so I’ve neglected to spend much time working with develop presets.

So let’s talk about exposure. Lightroom provides an exposure histogram in the upper right pane. The histogram quantifies the amount of light found between black, at the left end, and white, at the right side of the plot. A histogram with nothing but a steep peak at the right end will likely appear washed out or overexposed; likewise, a plot with nothing but a peak at the far left will be dark, lacking highlights.

Lightroom 2 histogram screenshot

Here’s what this particular histogram is telling us:

  • In its histogram display, Lightroom provides some basic image information: ISO, focal length, aperture, and shutter speed.
  • We have light basically all throughout the plot’s range, with a particular peak close to the bright end.
  • Overall, the exposure of this image isn’t bad. We can adjust exposure either with the exposure slider or by grabbing and dragging the center portion of the histogram left or right to obtain the kind of effect we want to get. I tend to boost exposure a bit when working up my photos —- but be careful when sliding exposure rightward: too much will add speckly noise to the image.
  • The filled triangles at the upper left and right corners are clipping indicators; since they’re filled, it means that this image has some amount of both cut off highlights (right end of histogram: “blown highlights”) and clipped darks (left end of histogram). That is, some detail is lost in the brightest and darkest areas of the photos. The more clipping, the brighter the fill of the triangles. You can see the clipping in the histogram as the blue peak pressed up against the left edge, and the grey/red smooshed into the right end. To see just what’s lost, hit J. The blue and red superimposed over the image represent lost darks and lights, respectively.

Here’s a sample image. On the right is an illustration of the highlight clipping revealed by hitting J in the develop module:

Lightroom 2 sample image Lightroom 2 sample image

To bring a bit more detail back into this image, especially some of the texture in that yukon gold, you use the “recover” slider in the develop pane, or simply drag the rightmost edge of the histogram back toward the left side: hover the mouse along different parts of the histogram to identify the various draggable regions. As you increase the “recovery” value or drag that right end leftward, you’ll see the red blown highlights indications start to fade, as in the image below where the recovery slider has been pegged all the way rightward:

Lightroom 2 sample image Lightroom 2 sample image

Adjust per taste. See how much more gray the background of this image has become by pegging the recovery? Lightroom can often recover a ton of detail in highlights, but at the extreme end the cost will be a dimming of the overall image.

The same goes for darks: You can bring detail back out of a black swatch of image by reducing the “blacks” slider or by dragging the leftmost end of the histogram back to the right a bit. I often find it works nicely to drag that histogram until the leftmost slope of the dark end of the plot rests just at the edge of the display — that is, where you’ve just barely recovered all the clipped dark areas.

While measurements of light and dark can be quantified in the histogram, appreciation of light and dark are subjective. Leaving blown highlights (or intentionally blowing them by increasing the exposure — grab the middle of that histogram and pull it rightwards until you see something you like) and lost black regions of an image may help convey exactly what you want an image to do.

One more exposure-related tip: Fill light. Use this slider (or, as always, slide the histogram itself — the fill light region is just shy of the leftmost “darks” region of the plot) to bring up the light in the image’s shadowy regions without boosting the overall exposure. This can do wonders for errant shadows across a face.

Be watchful for new noise when you add fill light, and it’s a good idea to bump up the “clarity“ slider in conjunction with fill light, since fill light tends to take a bit of the punch out of the image.

So, there’s a quick take on adjusting exposure with Lightroom 2. Between white balance and exposure, you have the core set of adjustments to your raw images covered, but there’s more to come: Further tuning involves sharpening, noise reduction, and crops, as well as other adjustments we might make to color. Some discussion of those are coming up in my next installment of Lightroom for the Rest of Us (or whatever it is I’ll be calling this series by then).

From Raw to Rawwwr: Lightroom 2 Raw Development for the Rest of Us

I have a casual obsession with Lightroom 2 and have had a load of fun tinkering with the Lightroom catalog database to extract information about my photographs. More recently, I’ve been writing over the past handful of weeks about my workflow in Lightroom 2 from the perspective of an enthusiastic but non-professional user. I’ve previously covered organization and keywords. This time around, the topic is using LR2 to work up raw photos.

Why would one shoot in raw? Raw is an image format meant to preserve as much original image data as possible; that information can be manipulated much more flexibly and effectively than the comparably limited range of image data contained in a JPG or TIFF image. A raw image with bad exposure or white balance can be salvaged, while a JPG — lacking the image information of raw — offers far less latitude for recovery. Meanwhile, JPGs produced by most digital cameras have some amount of sharpening, exposure, and contrast adjustment applied in-camera, while raw images are essentially straight representations of what the camera “saw” when taking the photo. This means that raw images will almost always need a bit of color tweaking and sharpening. Hence the eternal quest for a reliable, easy-to-apply workflow for “developing” raw images to best effect, and the subject that brings me to the MacBook today.

After importing and doing preliminary tagging, flagging and deleting of images, I start in on working up the raw images.

White Balance

White Balance is the first thing to tackle. The point of correcting white balance is to give the right color tone to the “neutral” (white or grey) colors in your image. In other words, you want white to look white. If the WB is off, your photos will have an unnaturally cool or warm cast.

In Lightroom 2, you can adjust white balance in both develop and library modules using presets for different light types, and in the develop module via the temperature sliders. (There are a couple of quick-develop buttons for temperature, but I generally avoid using them.)

The most common white balance adjustment I make starts with selecting the “tungsten” preset. This immediately removes the too-hot feel of photos taken in incandescent light — ie, most sources of indoor, non-flash light.

LR2 screenshot

After using the Tungsten preset, it’s usually necessary to make a few adjustments: This is when I use the Tint and Temperature sliders in the develop module for subtle shifts, often to add just a bit more warmth to the light by nudging the Temp control a tiny bit back to the right. It’s a good idea to swing the Temp control around a bit just to see what kind of difference it makes to give a bit more warmth or coolness to an image.

Mixed light provides a dilemma for white balance. Light from an overhead lamp plus natural sunlight through a window, for example, can be tricky to adjust. I find that setting the Tungsten preset will cool off the overall color cast, but will also amplify the parts of the image that are already a bit cooler — the natural sunlight — giving them a sharp blue tone, especially around highlights. My solution to this is to desaturate the blues a bit, which takes the edge off that coolness. In Lightroom 2, you have even more ability to make that correction by using the adjustment brush to spot-desaturate the highlights that are made too cold by adjusting to Tungsten. The below shot illustrates an image that’s been tweaked by first presetting WB to Tungsten, and then backing off the blue saturation just a few points.

LR2 screenshot

But wait, there’s more! While the Tungsten preset is good, it’s not always quite right. As alternative, use the White Balance Dropper — that’s the dropper button next to the WB selector in the develop module. Click it, then click a spot in your image that should be nice and neutral, a white or grey spot. Presto! Instant white balance. When I can’t quite decide on the right balance, I often use this tool on various spots of the image to quickly try out a range of white balances. The shortcut for the WB dropper is W, which you can use in both grid and develop modes.

Once you’re happy with the white balance of a given image, you can quickly apply those settings to the remainder of similar images with the “sync settings” command: Swap over to grid mode, select the corrected image first, and then click-select the others with similar light, and finally sync ( shift-cmd-S).

There’s much more to the raw workflow: Exposure, sharpening, and so on, and I’ll tackle some of those next time.

My Lightroom 2 Backup Strategy

Related: A more recent post about archive and backup in Lightroom.

With this morning’s comment from martie asking about a crashed hard drive, I got to thinking about making my own Lightroom 2 backup plan a bit more automated and reliable. My general approach is to periodically copy my catalog file and image directories to an external hard drive, but there’s been nothing systematic about it until now.

I’ve previously described a bit of my Lightroom file structure, noting that I import new photos into a single directory per import. As part of a strategy to save space on the MacBook where I do my actual work, I periodically move those folders to an external hard disk currently named Grundle. This is simply a matter of dragging the folder, in the left-hand directories pane of Lightroom, from one hard drive to another.

Lightroom display of multiple drives

While this copying step is manual, the rest of the system is now automated, thanks to this tutorial at MacResearch and a bash script by Aidan Clark. The bash script took just a bit of tinkering to work with Lightroom’s catalog file, which by default will have rsync-breaking spaces in it, and to perform the second backup from the external volume to the iMac. I’ll post those specific and very minor modifications if there is interest.

Here’s the final result: Using OS X’s launchd tool, whenever I mount Grundle on my MacBook, whether via network or direct firewire connection, my Lightroom 2 catalog file is copied to Grundle using rsync. And, whenever I mount Grundle on the upstairs iMac, a similar combination of launchd and rsync copies both the catalog file and the image directories from Grundle to the iMac. This means that in the course of regular use of my two Macs and that external drive, both my Lightroom catalog and folders full of images get backed up.

One caveat to this system is that the backup of the image folders still involves that manual step of moving them from the laptop to Grundle. I could automate this the same way the catalog backup is done, but that could potentially mean trying to backup a gig or more at a time over the wifi network — a time- and bandwidth- consuming process that isn’t really necessary. Now, the obvious down-side is that the newest photos I’ve taken are always the ones most vulnerable to data loss, and that’s obviously not a highly desirable thing. But I’m satisfied with my current workflow of moving folders to Grundle generally when I’m done working with that set of images. I’ll continue to think about this situation and may come up with some additional redundancy for that stage of processing.

Update: Okay, I buckled. A bit more tinkering and I now have my current folders of raw images copied to Grundle. After I relocate the folder using Lightroom, the folder will disappear from the backup directory, so I don’t have redundant backup files stacking up anywhere. Nice and clean, and everything’s safe.

Update the second: One item I neglected to mention in the original post was the automated backup feature built in to Lightroom: Available in the catalog settings menu (alt-cmd-,) this feature performs scheduled backups of your catalog file only, to a location you specify, and can be set to run a backup on any of several schedules. My process above includes allowing that backup to run weekly — it never hurts to have a little more failsafe security. The benefit of automating getting that backup to another hard drive is one more important layer of keeping safe your data.


About, the short version

I’m a sociologist-errant. This site is powered by Textpattern, Pair Networks and the sociological imagination. For more about me and this site, see the long version.

RSS feed