.
Jeffrey’s “Focal-length Sort” Lightroom Plugin
Quick Links
· Latest Download:
     focal-length-sort-20120428.28.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 fills a specific hole in Lightroom's “Grid Filter”, adding new fields by which you can filter images: “Focal Length” and “Focal Length in 35mm”.

This plugin works in Lightroom 4, Lightroom 3, and Lightroom 2. (Though for Lightroom 3, you must have at least version 3.5)

The same download works for both Windows and Mac. See the box to the upper right for the download link link (in orange) and installation instructions.

Note: a Lightroom major upgrade, such as from Lr3 to Lr4, de-registers the plugin in the upgraded version, thus requiring a new (1-cent if you like) registration code in the upgraded version. It makes for a hassle every couple of years, I know. Sorry. See this note for details.

Focal Length” is the raw focal length of the lens, while “Focal Length in 35mm” 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 on plugin registration and on how I came into this hobby of Lightroom plugin development, see my Plugin Registration page.

Version History
( Update Log via RSS )

20120428.28 Added another Canon camera.
20120413.27

Added some recent Canon SLRs. It's unfortunate that I have to do this, since there's a perfectly good Exif field for them to indicate the 35mm-equiv focal length, but Canon doesn't use it. Sigh.

Enhanced the send-log dialog to hopefully make reports more meaningful to me, yielding, I hope, the ability to respond more sensibly to more reports.

20120330.26 Update to handle 4.1RC
20120325.25 Added a bunch of Canon compacts to the database, and fixed a few that had been incorrect.
20120312.24 Added some more cameras to the database.
20120309.23 Had broken registrations in Lr2; Update to the debug logging to better track down timing issues that might arise.
20120304.22

More updates for Lr4.

20120221.21

More updates for Lr4.

20120131.20

Added a bunch of data to the crop-factor database.

More on the march toward Lr4, including upheaval in the code to handle Lightroom APIs being discontinued in Lr4.

20120114.19 More tweaks for Lr4b
20120112.18

Update for Lr4 beta: explain in the plugin manager that the plugin can't be registered in the beta.

20111210.17

Had issues with the registration button sometimes not showing.

Added a system-clock check and reports to the user if the system clock is more than a minute out of date. An incorrect system clock can cause problems with various kinds of communication and authentication with some of my plugins, so I've just gone ahead and added this to every plugin.

20111030.16

When doing a plugin upgrade, offer the ability to flush all the old copies of the plugin.

More updates to the internal crop-factor database. I really need to figure out a way to crowdsource this data.

20110908.15 A few updates to the internal crop-factor database.
20110628.14 Updated the internal crop-factor database for the Fuji X100, which doesn't seem to include its crop factor in its metadata.
20100829.13 Made the revalidation process much simpler, doing away with the silly need for a revalidation file.
20100822.12 Assume any camera-model Exif with 'scan' in it is from a film/slide scanner, and treat as a full-frame size.
20100820.11 Discovered 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.10 Added code to allow plugin revalidation after having been locked due to a bad Lightroom serial number.
20100625.9 Yikes, shaking out some more build issues.
20100624.8 Discovered 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.6 Added support for the Canon 550D/KissX4/T2i, which for some reason doesn't include the 35mm-equivelant focal length in its metadata
20100516.5 Update 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.3 Minor internal debugging tweaks.
20091126.2 Added 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.1 First 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 (2 years, 6 months ago) comment permalink

Great work. Again.

— comment by Paul C on November 25th, 2009 at 3:40am JST (2 years, 6 months 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 (2 years, 6 months 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 (2 years, 6 months 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 (2 years, 6 months 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 (2 years, 5 months 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 (2 years, 3 months 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 (2 years, 2 months 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 year, 10 months 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 year, 10 months ago) comment permalink

Hi Jeffrey
The plug in does not work for me. I have registered and done everything you suggested.
I am using LR4. It shows me in the metadata filter all the camera, lenses and focal lenght I have used so far, but when I click on a single camera, lens or focal lenght it says that no phot match the filter.
I have calculate the focal lenght for the entire catalog, disable and enable the plug in , close LR and relaunched but nothing seems to work. Am I missing something?

thank you

You might be getting bit by a Map-related bug… visit the Map module and make sure the mapping filter is disabled, then return to Library. I think that bug is fixed in the 4.1RC. —Jeffrey

— comment by Stefano on April 27th, 2012 at 12:50am JST (2 weeks, 6 days ago) comment permalink

I have installed LR 4.1 and it works now

thank you

— comment by Stefano on April 27th, 2012 at 7:53pm JST (2 weeks, 6 days ago) comment permalink
Leave a comment...


All comments are invisible to others until Jeffrey approves them.

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