Subscribe to Latest Posts

11 Mar 2012

Tweaking a custom sort order in Lightroom 3

Posted by dap. Comments Off

Lightroom 3′s SmugMug integration is pretty great: each SmugMug gallery shows up as a collection under “Publish Services”, you drag photos over there, and click “Publish” when you’re ready to upload them. With the latest update, you can even sync from SmugMug to link photos you published prior to LR3 and many other changes made on the SmugMug side.

But one problem I’ve run into with this approach is sorting the photos. There are many sites that explain sorting in Lightroom, but basically it works like this: within a given collection or folder, you can have Lightroom sort by any number of fields like name, shooting time, rating, caption, etc. You can also have a user-specified sort order, where you drag photos around and Lightroom remembers the order you assigned. You can even switch between your custom sort and the canned ones: you can switch from custom to by-date and back to custom again, and it will remember the last custom sort for each collection.

This is great, but there’s one problem: sometimes the initial user sort order appears random, and the other sorts aren’t quite right but they’re close. As an example, my Point Reyes gallery is mostly sorted chronologically so that photos of the same subject (like the Pierce Point Ranch) appear together. But I took this sign photo:

Drake's Bay Oyster Company (1)

after a few other photos from the same place:

Drake's Bay Oyster Company (2)

As you can see, the sign photo makes more sense to appear before the others as an establishing shot. This may seem pretty picky (and it is), but the order of the photos can really affect the experience people have in seeing them, so I pay some attention to it.

In this case, I want to sort by capture time and then tweak the resulting order. But if you sort by capture time and then try to drag a photo to change the order, Lightroom immediately drops you into whatever custom sort was there before, completely reordering all the photos. I couldn’t find a straightforward way to do a one-time automatic sort while staying in custom mode: either you’re automatically sorting by something like capture date, in which case you can’t make any changes, or you’re in user sort mode, in which case you have to sort all the photos by hand. Here’s how I did it:

  1. Start with an empty Quick Collection (or use some other empty collection as a temporary holding place).
  2. Select the collection you want to sort. Select all the photos. Press ‘B’ to add all the photos to the Quick Collection (or drag the photos to whatever other temporary holding place you want).
  3. Remove all the photos from the collection you want to sort. At this point, your Quick Collection should now be full of all the photos from the collection you want to sort, and that collection should be empty.
  4. Navigate to the quick collection. Sort these photos by Date Captured (or whatever you want).
  5. Now add the photos back to the collection you wanted to sort.

That’s it. (If you want, remove them all from the Quick Collection, too.) It looks like all we did was move the photos back and forth, but it works because the initial user sort order for a collection seems to be the order in which you added the photos, and when you add a bunch of photos to a collection they get added in the order they were in wherever you moved them from. By moving the photos from a temporary collection sorted by date, they wind up in a custom sort, but ordered by date. Now you can make whatever tweaks you want to the order without having to manually sort them from scratch.

Of course, do leave a comment below if there’s a better way to do this!


3 Jul 2011

Exporting keywords in Lightroom

Posted by dap. Comments Off

I use keywords extensively. In any given photo, I’ll keyword names of people I know, the location, prominent subjects (like birds, trees, a museum), and types of photo (like landscape, nighttime, macro). Take this one:

Dolores Park at Night

I’ve tagged this one with: skyline (a subject), cityscape (a subject and type of photo), dolores-park, mission (the location), night (time of day), and time-lapse (type of photo).

Unlike like popular wisdom, I keyword all the photos I don’t reject, rather than just the ones I’ve selected to actually work on. I do this partly because I’m always a fastidious organizer, but also because I want to build a library of my own stock photography for blog posts and other projects. For that to be useful, it needs to be easy to search through.

When I export photos to my galleries, until recently I’ve deliberately excluded keywords by checking the “minimize embedded metadata” option when exporting. But this has several problems:

  • Leaving out keywords makes it harder for search engines to identify the photos.
  • Minimizing metadata also leaves out camera settings like shutter speed and focal length, which I’d prefer to keep since I like seeing that in other people’s photos.
  • Minimizing metadata also leaves out captions, so I need to manually enter those after exporting.

I could just stop checking this option, but I haven’t been careful about marking some keywords private (i.e. not for export). For example, I have keywords that include addressess of friends’ homes, which I’d rather not include on a picture of their house. But inside Lightroom, there’s no good way to change the “export” setting for multiple keywords, so fixing this would be a very manual process.

I looked around and found other people with the same problem, but it sounds like the only supported way to fix this without going through the 4-click process for each keyword is using the Lightroom SDK. Having never seen Lua or the SDK before, I was able to throw together a little plugin that did what I wanted in a morning. It has no UI, though, so it’s not flexible. It just does exactly what I needed for this case:

  • If a top-level keyword is not exported, all of its child keywords should not be exported. The plugin hides all keywords under a top-level one that’s not exported.
  • If a top-level keyword is exported, most of its child keywords should also be exported. There are some exceptions, so the plugin just logs a message when it finds an exception to this rule.

I haven’t bothered packaging this as a plugin because it’s so specific, but I’ve provided the code below in case anyone needs to do something similar in the future. Caveat: I’m not a Lightroom engineer, and this code may not do what you want, or it may eat your catalog. Always backup your catalog before making changes like this.

-- This script is provided for reference only.  Do *not* run this without
-- understanding how it works.  It was written by an amateur.
-- This script is intended to hide keywords whose top-level parent keyword is
-- not hidden (marked for export), and warn about keywords which are hidden
-- whose top-level parent is not hidden.  That is, this script iterates the
-- keywords in the active catalog.  For each one, if its top-level parent
-- keyword is marked for export but this keyword is not, the script prints a
-- warning.  If its top-level parent keyword is not marked for export but the
-- keyword itself is, this script unmarks the keyword for export.

local LrDialogs = import 'LrDialogs'
local LrLogger = import 'LrLogger'

local log = LrLogger( 'dapLogger' )
log:enable( "logfile" )

-- Track how many keywords we've hidden.
local nhidden = 0;

-- Hide the given keyword and its children (recursively).
local function fixKeyword(keyword)
	local attrs = keyword:getAttributes()

	if not attrs.includeOnExport then
		log:trace("skipping '" .. keyword:getName() .. "' (already not exported)")
		log:trace("hide keyword '" .. keyword:getName() .. "'")
		keyword:setAttributes({ includeOnExport = false });
		nhidden = nhidden + 1

	for key,child in pairs(keyword:getChildren()) do

-- Check that the given keyword and its children are not hidden (recursively).
local function checkKeyword(keyword)
	local attrs = keyword:getAttributes()

	if not attrs.includeOnExport then
		log:trace("surprised to find '" .. keyword:getName() .. "' not exported");

	for key,child in pairs(keyword:getChildren()) do

-- Body of this operation: start an asynchronous task that modifies the catalog
-- as described above.
import "LrTasks".startAsyncTask(function ()
	local catalog = import "LrApplication".activeCatalog()
	local allkeywords = catalog:getKeywords()

	catalog:withWriteAccessDo('Hide specific keywords', function ()
		for key,keyword in pairs(allkeywords) do
			local attrs = keyword:getAttributes()
			if not attrs.includeOnExport then

	LrDialogs.message('Hid ' .. nhidden .. ' keywords.', '', 'info')


25 Jun 2011

Fort Funston

Posted by dap. Comments Off

Location: Fort Funston Rd,
San Francisco

View larger map
More info: Official site
Bay Area Hiker
Highlights: Hanggliders
Beautiful view of coast
Easy, paved walking trails
Lots of dog walkers
Parking: Large free lot (but popular)
Fees: None

Hang glider at Fort Funston

Fort Funston is definitely worth a visit for an easy stroll along the coastal bluffs, especially when it’s nice, windy weather for hang gliding. Actually, just watching the hang gliders taking off at close range is an exciting experience. Just off the parking lot is an observation deck with a great view of the launch point and beautiful views up and down the coast:

Hang glider taking off at Fort Funston

There aren’t a lot of long walking trails here (1.5 miles, according to Bay Area Hiker), but what’s there is nice. The paved road gently winds up the coast and loops back. You’ll probably see lots of other people, their dogs, and hang gliders. I’m told there are beautiful wildflowers along most of the trails, but we didn’t see much of that when we went.

For photography: it’s easy to get great action shots of hang gliders, but it’s deceptively hard to take great photos of beautiful vistas. If you’re up for that challenge, there are plenty of nice vantage points.

View from Fort Funston

The old military structures make for some interesting photos, too:

Military structures at Fort Funston

I’d only brought my 35mm prime with me the day I went, but I’ll definitely be coming back with both my wide lens and tele!

19 Jun 2011

Why you should shoot in manual mode

Posted by dap. Comments Off

If you’re like most amateur photographers, you spend most of your time shooting in one of the semi-automatic exposure modes: program auto (P), aperture-priority (A), or shutter-priority (S). In this post, I’ll make the case for trying out shooting in fully manual mode (M).

If you’ve used M a lot already, or if you’ve never taken your camera off fully-automatic, then this post isn’t for you. For the rest of you who use P, A, or S, my claim probably sounds crazy. When I bought my DSLR, I barely considered M. I viewed it as a useful feature for when I might someday want that level of control, but I figured it would be hard to use and that if I got to the point where I needed it, then I’d probably know how to use it. I changed my mind after hearing a professional photographer recommend that beginners start with M early on because it forces students to more deeply understand the tradeoffs around aperture and shutter speed. That’s a fine reason, and an important side effect of using M, but the main reason I primarily shoot manual now is much more compelling: I find it much simpler than the alternatives. That’s partly because M is simpler than I thought it would be, and partly because P, A, and S are harder than I realized.

Manual is not as hard as you think

Most online resources and camera manuals describe these shooting modes something like this:

  • Program auto (P): you choose from various combinations of shutter speed and aperture that produce a “proper” exposure (as determined by the camera’s meter)
  • Aperture-priority (A): you choose the aperture, and the camera chooses the shutter speed that will produce a “proper” exposure (as determined by the camera’s meter)
  • Shutter-priority (S): you choose the shutter speed, and the camera chooses the aperture that will produce a “proper” exposure (as determined by the camera’s meter)
  • Manual (M): you choose both shutter speed and aperture.

But it’s important to remember that in all of these modes, the camera’s built-in meter figures out what it thinks is a proper exposure, conveys that to you, and lets you make the final choice. Even in manual mode, you still see the camera’s meter, so you can tell if your current settings match those the camera would pick. If you want to play with M, it’s very easy to take the exact same photos you would take in the other three modes by simply tweaking the settings to match the camera’s recommended exposure. The only difference is that you’d be spending more time getting the settings right, but there’s nothing “harder” about it since you’re just moving the dial until the camera meter reads “correct exposure”.

Oklahoma City Memorial

Oklahoma City Memorial

The semi-automatic modes are not as easy as you think

A lot of people believe the first three modes, sometimes called semi-automatic modes, are simpler than M because there are fewer parameters. In A, you don’t worry about the shutter speed, and in S you don’t worry about the aperture. In M, you have to worry about both, and many beginners aren’t comfortable with that yet.

That’s a fair summary when the camera meter is correct. But it often isn’t. In fact, many more of my photos than not are taken with slight changes from the camera’s recommended exposure. In the semi-automatic modes, you can tweak an invented parameter called “exposure compensation”, which basically overrides the camera’s recommended exposure by biasing it in one direction or the other. For example, if the camera thinks there’s less light than there actually is, the default setting would over-expose the image. In that case you’d add negative exposure compensation to cause the camera to pick an exposure closer to what it should be. In manual mode, you just adjust the aperture or shutter speed, which is what you’re already doing.

Besides that, I found that in aperture priority mode, I often wound up with a shutter speed that was too long and allowed visible motion blur. Similarly in shutter-priority, I’d wind up with an aperture that was too large, giving too little depth of field and an overall unfocused image. Both of these effects are much worse than underexposure. I learned what in retrospect is obvious: shooting in aperture or shutter priority doesn’t enable you to ignore the other variable. The camera’s not magic.

Considering these two points, you might more accurately describe the four modes like this:

  • Program auto: you choose (1) exposure compensation and (2) which one of the camera’s aperture/shutter speed pairings to use.
  • Aperture-priority: you choose (1) exposure compensation and (2) which aperture to use. (But in the back of your mind, you still have to worry about (3) the shutter speed because of motion blur, though admittedly not as much.)
  • Shutter-priority: you choose (1) exposure compensation and (2) which shutter speed to use. (But in the back of your mind, you still have to worry about (3) the aperture because of depth of field, though admittedly not as much.)
  • Manual: you choose (1) aperture and (2) shutter speed.

The way I see it, in each of these modes, you really have to choose at least two variables. In manual mode, both variables are concrete: I can understand the impact of changing aperture and shutter speed. With the semi-automatic modes, you have this synthetic “exposure compensation” parameter, and I always found myself unsure how to manipulate it. And since you can’t truly forget about the other variable, in a sense you now have three variables to consider.

Small Stream in Muir Woods

Manual all the way?

If you believe everything I’ve said so far, you might now wonder why you would ever not use manual mode. Of course, there’s a reason these other modes exist. Even if you know what you’re doing, it takes longer to set exposure in M than P, S, or A. By definition in the semi-automatic modes you’re starting from something close to correct and fine-tuning it, while in M you may be all over the map.

If you’re shooting static subjects like landscapes, nature, or studio subjects, and you have a lot of patience, shooting in M probably makes a lot of sense. If you’re shooting sports, street photography, or night photography, your ability to take a shot at the right moment is much more important than nailing the exposure, so the semi-automatic modes make a lot of sense. (It would be a pretty cool feature to have a button in manual mode that reset the exposure to one of the valid P modes so you wouldn’t have to waste time getting the exposure in the ballpark.)

With all of the above understood, I’d phrase the choice like this:

  • Program auto, aperture-priority, and shutter-priority: let the camera pick a good starting point for the exposure, but then fine-tune it. Expect that you will be adjusting exposure compensation on most shots.
  • Manual: you get the camera’s advice about the exposure, but you set it from scratch.

In the end, it’s your choice

Like so many things in photography and life, I started on one side of this (using semi-automatic mode), switched over (using manual mode almost exclusively), and now find myself somewhere in between. But the difference is I’ve got a much better understanding than before. Like the photographer I mentioned above, I recommend playing around with manual mode (extensively, not just for an afternoon) if for no other reason than to understand more viscerally what the camera’s doing for you in the semi-automatic modes.

I still prefer manual mode for most of my shooting for the reasons I mentioned above: most of my subjects are not fast-moving, and I’m more comfortable manipulating the underlying parameters directly than trying to guess how exposure compensation will affect things. I’m also pretty willing to deal with the many incorrectly exposed photos I get by choosing wrong, since Lightroom makes dealing with all the rejects pretty easy. But lately I’ve been considering switching back to A for speed and as a convenience. The key is to still think in terms of the aperture and shutter speed, not exposure compensation. So if nothing else, my manual approach has helped me understand much better how to shoot in P, A, and S.

In the end, it’s all about results. I’m curious to hear how you prefer to shoot! Leave your comments below.

31 May 2011

About this site

Posted by dap. Comments Off

I’m a software engineer in San Francisco, California. I took up photography as a hobby in late 2009, and have been steadily learning as much as I can, both technically and artistically. I also really enjoy exploring the Bay Area, particularly the hills of San Francisco.

This blog has two main categories: Techniques and Places.

Techniques is where I’ll be sharing what I’ve learned technically and artistically in hopes it might help other budding amateur photographers out there. I intend to focus not on basic, broad concepts whose fundamentals are covered in tons of books and web sites, but rather on thoughtful technique: how you go about taking good photos. (For example, I won’t cover topics like what various camera modes do, but rather how those modes affect the way you take pictures.) I hope to see others share their own lessons learned too.

Places is where I’ll document great places to walk and shoot outdoors, especially in the Bay Area. I’ve often wished there was a good collection of such places with photos to see what they look like, but I don’t know of any such site.

I hope you enjoy this site and find it helpful. I’d love to get your feedback! You can mail me, dave, at davepacheco dot net.