.
Jeffrey’s “Focal-length Sort” Lightroom Plugin
Quick Links
· Latest Download:
     focal-length-sort-20100829.13.zip
· FAQ
· Version History
· Update Log via RSS
· Installation instructions
· “Donationware” Registration Info
· More Lightroom Goodies
· All-Plugin Update Log via RSS
· My Photo-Tech Posts
· My Blog

This plugin (for Lightroom 2 and later, Win and Mac) is designed to fill a specific hole in Lightroom's “Grid Filter”, adding new fields by which you can filter images: “Focal Length” and “Focal Length in 35mm”. The former is the raw focal length of the lens, while the latter is viewed in terms of the frame size of a 35mm film frame. With “full frame” pro cameras these values are the same, but they differ for most cameras. The 35mm version allows one to normalize the focal-lengths across cameras, judging general “field of view” without regard to the specifics of the camera.

This is similar in concept to my “Megapixel Sort” plugin, and a more explicit way to look at focal-length data than my “Data Plot” plugin.

Calculating and Recalculating

Unfortunately, the Lightroom plugin infrastructure does not yet allow for custom metadata to be created and updated automatically, so as you import new images to your catalog, you must explicitly tell the plugin to calculate these custom fields.

This plugin adds two items to the File > Plug-in Extras menu, “Calculate Focal-length Sort” and “Calculate Focal-length Sort for Entire Catalog”. The former calculates the two custom-metadata values for each selected image, while the later does it for every image in the current catalog.

Note: Focal lengths less than 10mm are rounded to the nearest tenth of a millimeter. After that, focal lengths up to 200mm are rounded to the nearest millimeter, while ones beyond that are rounded to the nearest even 5mm mark.

“Sorting” By Focal Length

You can't actually sort via focal length, even using this plugin, but you can use the Library Filter to do something close. The Library Filter is in the Grid Module; use the “/” key to bring it into view if it's not already visible.

(Be sure that you've calculated the plugin metadata, as described above, prior to this step.)

In the Library Filter, select “Metadata”, then click on one of the column heads and select either “Focal Length” or “Focal Length in 35mm”, depending on you want to view the data. You should then be presented with a list of focal lengths that apply to the currently-visible images.

You can then click on one of the focal lengths to isolate only the associated images.

Availability

This plugin is distributed as “donationware”. I have chosen to make it available for free — everyone can use it forever, without cost of any kind — but unless registered, its functionality is somewhat reduced after six weeks. Registration is done via PayPal, and if you choose to register, it costs the minimum 1-cent PayPal fee; any amount you'd like to add beyond PayPal's sliding fees as a gift to me is completely optional, and completely appreciated. For details, see my blog post titled Lightroom Plugin Development: Now With Added Encouragement. If you're interested in how I picked up a plugin-development hobby like this, see My Long Path To Lightroom Plugin Development.

Lightroom 3:

It's been a long and arduous road preparing for Lightroom 3, but it's finally out. My plugin registration system has changed for Lr3, for plugin versions released after Lr3 was released. Please see the registration page to understand the details before deciding whether to upgrade.

Version History

( Update Log via RSS )
20100829.13Made the revalidation process much simpler, doing away with the silly need for a revalidation file.
20100822.12Assume any camera-model Exif with 'scan' in it is from a film/slide scanner, and treat as a full-frame size.
20100820.11Discovered a bug in my plugin build system that caused horribly difficult-to-track-down errors in one plugin, so am pushing out rebuilt versions of all plugins just in case.
20100814.10Added code to allow plugin revalidation after having been locked due to a bad Lightroom serial number.
20100625.9Yikes, shaking out some more build issues.
20100624.8Discovered a nasty build bug; pushing a new version in case it affects this plugin.
20100609.7

This version can be registered in Lightroom 3. It can run in Lightroom 2 or Lightroom 3; it does not work in the Lr3 betas.

It uses my new registration system when run on Lightroom 3, which avoids some of the silly issues of the old one. Please take care to note the details on the registration page: use of this version (or later) of the plugin in Lightroom 3 requires a new registration code, even if you had registered some older version of the plugin.

20100518.6Added support for the Canon 550D/KissX4/T2i, which for some reason doesn't include the 35mm-equivelant focal length in its metadata
20100516.5Update for the Lr3 beta.
20100303.4

Completely changed how the one-click upgrade applies the newly-downloaded zip file, in the hopes that it'll work for more people. Rather than unzipping over the old copy, it now unzips to a temporary folder, then moves the old folder out of the way and the new folder into place. Prior versions' folders are now maintained (with the version number in the folder) in case you want to revert a version; you may want to clear them out from time to time. Of course, it won't take affect until you try to upgrade after having upgraded to or beyond this version.

20091205.3Minor internal debugging tweaks.
20091126.2Added two more custom metadata fields, "Cropped" (yes or no) and "Post-Crop Focal Length 35mm", which indicates the effective focal length (in terms of a 35mm camera) of the crop. If there's no crop at all (or no crop on one of the sides) it's the same as "Focal Length 35mm". Otherwise, it's larger.
20091124.1First public release.

Comments so far....

Hey Jeffrey,
you are really the best! You programmed this plugin that fast I can’t believe it! This is exactly what we had in Lightroom 1 and I longed for it. Manymany thanks from Berlin
Sven
I know that some people also waited for this feature in LR, so I’m gonna spread it over the forums :D

— comment by fotografieBerliner on November 24th, 2009 at 11:13pm JST (9 months, 8 days ago) comment permalink

Great work. Again.

— comment by Paul C on November 25th, 2009 at 3:40am JST (9 months, 8 days ago) comment permalink

Well done and thank you
This function is really missing in LR
It will now be possible to have standard presets of vignetting and chromatic aberrration by range of focal and aperture

— comment by Herve on November 25th, 2009 at 8:04am JST (9 months, 8 days ago) comment permalink

Hi Jeffrey
I forgot to mention :
do you think possible to modify the smart collection menu so we can sort photos by range of focals (between xx and yy)
For the moment we can only use “contains” etc….which, if I write “17″, selects 17mm AND 170mm ,
Logical, but not very useful

No, sorry, LR doesn’t allow for it. —Jeffrey

— comment by Herve on November 25th, 2009 at 8:13am JST (9 months, 8 days ago) comment permalink

You seem to be reading my mind… just last weekend I was thinking of a way to convert crop to effective focal length. Thanks for yet another useful plugin!

— comment by JasonP on November 26th, 2009 at 8:41pm JST (9 months, 6 days ago) comment permalink

Hi Jeffrey,

This plugin is more than welcome. Works like a charm!

Thanx, Martin

— comment by L.M.A. van der Linden on December 3rd, 2009 at 5:04pm JST (8 months, 30 days ago) comment permalink

So happy to find this. Is there a way to print out the focal length breakdown that shows in the Library Filter?

Take a screenshot? :-) —Jeffrey

— comment by George on February 8th, 2010 at 10:32pm JST (6 months, 22 days ago) comment permalink

Jeffrey,

I use this plug-in and discovered that in some cases it displays a question mark (?) if the image does not have the FocalLengthIn35mmFormat label defined. Upon clicking on the ? line, the images that do not have that label are displayed (filtered). This is working as expected.

However in some cases there another entry “No Value” which is always at the bottom of the. Upon clicking that entry the line is highlighted but the filter is not engaged, the same set of pictures is displayed. Thus, I can not determine what metadata tag is involved.

This is not a big deal, but it is in all likelihood a bug that you might want to eliminate at some point.

Regards, Josh

I’m guessing that it’s a bug in LR2. Plugin custom metadata can be frustratingly iffy in LR2’s filter (try restarting LR, and it might work). Try it again in the real LR3 when it comes out and it should all work fine. —Jeffrey

— comment by Josh on March 6th, 2010 at 10:22pm JST (5 months, 27 days ago) comment permalink

Jeffrey, this issue is solved under LR 3, thanks.

Just out of curiosity: are you using the FocalLengthIn35mm EXIF variable in any way? How do you compute the value, if not? Would it be possible to write back the computed value into the metadata of the image? I am messing with a couple of small cameras that do not provide the FocalLengthIn35mm and need to massage them using exiftool. Amazingly, it is possible to at least display that variable (using your metadata config tool: ‘com.adobe.focalLength35mm’), but it is not possible to sort on it or put it in a smart collection. I was wondering if your variable is related to it and how. And again, it would be very convenient if your plugin could write back the computed value into the image (or at least into the FocalLengthIn35mm variable in the database).

– Josh

Lightroom doesn’t give access to the FocalLengthIn35mm even if the image has it, so the plugin doesn’t use it. I compute it based upon the camera make/model and a large database of sensor sizes. It would be much better if I could use FocalLengthIn35mm directly, because that would take into account camera setups that don’t use the full sensor (e.g. the high-speed crop in some Nikons). The plugin keeps the data in its info.regex.lightroom.focallengthsort.FL35 field… I’ve updated my metadata-presets plugin to work with it… but I don’t know of any way to access it via a smart collection or the like. —Jeffrey

— comment by Josh on July 11th, 2010 at 5:34pm JST (1 month, 22 days ago) comment permalink

I see. What a pity. How often can you update the database? My new little cam is apparently not in it yet (FujiFilm FinePix JZ300). When I run “Calculate focal length sort” on it, the FocalLength in 35mm changes from “No value” to “?”, I take that’s because there is no entry for it in the database.
I asked a similar question (the 35mm value is computed) on Phil Harvey’s exiftool forum and Phil replied:

The computation is based on the FocalPlaneX/YResolution tags unless the FocalLengthIn35mmFormat tag exists already in which case it is used. See the Composite tag name documentation for a list of tags used in the calculation. (Also look up the tags used in calculating ScaleFactor35efl. Note that some of these are used only if others are not available.)

Maybe one needs a LR Plugin Interface for exiftool :-)

Thanks, Josh

Send me a sample shot (of a blank wall, or better yet, something interesting :-) ) and I’ll add it to the database. I use ExifTool in a number of my plugins, but limitations in Lightroom and in Windows make it somewhat of a heavy hammer. Macs come with Perl installed, but Windows doesn’t and never will, so I have to include a full Perl run-time environment in the plugin, which is both fragile and bloating. And frankly, it’s not all that popular of a plugin, so I’m reticent to spend much time on it when time spent elsewhere can benefit many. —Jeffrey

— comment by Josh on July 13th, 2010 at 1:34am JST (1 month, 21 days ago) comment permalink
Leave a comment...


All comments are invisible to others until Jeffrey approves them, so spam can be filtered before it goes live.

Please mention what part of the world you're writing from, if you don't mind. It's always interesting to see where people are visiting from.

More or less plain text — see below for allowed markup

You can use the following tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting