.
Jeffrey’s “Focal-length Sort” Lightroom Plugin

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 5 (and older versions as far back as Lightroom 2, though some features depend on the version of Lightroom).

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

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.

(Also see my powerful Data Explorer plugin, which lets you partition and group imgaes by different data-related criteria, including the focal length.)

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 latter 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.

Note: a Lightroom major upgrade, such as from Lr4 to Lr5, de-registers the plugin in the upgraded version, so if you want to maintain registration, a new ($0.01 if you like) registration code is needed in the upgraded version. It makes for a hassle every couple of years, I know. Sorry. See this note for details.

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 )

20140715.58

Fixed an issue with Creative-Cloud revalidation.

20140712.57

Lr5.5 and later Creative-Cloud installs can now revalidate themselves if needed.

20140710.56 Sigh, had a bug in the Creative-Cloud support.
20140708.55

Now supports Lr5.5+ Creative-Cloud Installs.

20140704.54 Sigh, introduced an error for some folks with the rebuild the other day.
20140630.53 Build-system update
20140622.52

Added an "Expunge Plugin Data" section to the plugin manager, to allow plugin data to be cleared from the catalog.

20140422.51

Fixed a bug in the "smoother revalidation" stuff recently added.

20140417.50

Make the revalidation process smoother, especially for folks using Lr5.4 and later.

20130926.49 Oops, fix a bug introduced in the previous update
20130925.48 Updated the camera crop factor database.
20130910.47 Added a bunch of cameras to the crop-factor database.
20130830.46 Added a few more cameras to the crop-factor database.
20130721.45 Added Canon 650D to the camera sensor-crop database
20130626.44 Added a bunch of data to the crop-factor database
20130613.43 Better support for plugin revalidation.
20130611.42 Yet another Lr5 update
20130527.41

Corrected the crop-factor data for the Canon Powershot G1 X.

Added crop data for a bunch of Ricoh cameras, some Canon, and another Fujifilm.

20130526.40 Added some crop-factor data for a bunch of Fujifilm cameras
20130524.39 Apparently, a recent change broke things on Lr2, which some folks apparently still use.
20130501.38 Update for Lr5
20130412.37 Build system update.
20130330.36 Added some Ricoh cameras to the crop-factor database.
20130328.35 Fix for the registration system.
20130209.34 More build-system maintenance
20130206.33 Tweak for my registration system
20130124.31 Added a bunch of Canon cameras to the crop-factor database.
20120608.30 Fix an "attempt to perform arithmetic on field" error.
20120526.29

Update to handle the Mac App Store version of Lightroom.

Tweak for Lr4.1RC2.

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 (4 years, 8 months ago) comment permalink

Great work. Again.

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

Hi Jeffrey,

I would really like to see a Lightroom plugin that crops an image according pre-defined focal lengths. When you have an image shot with a 24mm lens it is not possible to see when 35mm, 50mm, 70mm or whatever focal length, is reached during cropping. It is possible with the focal-length sort to see it but only after cropping and that is a bit laborious.

regards, Martin

— comment by Martin on January 22nd, 2013 at 8:18pm JST (1 year, 6 months ago) comment permalink

Hi Jeffrey:

I just installed the Focal-Length Sort plugin, which is a godsend for me as I have used many small-sensor cameras over the years and until now have had no idea what focal length equivalent I was shooting at. After running it on my catalog, I noticed that all my Ricoh GRD2 images came up with question marks (?), which I take to mean that the GRD2 isn’t in your database. It has a fixed 28 mm equivalent lens, so a) can you add it to your database, and/or b) is there a way for me to manually edit the image files in my catalog to insert “28″ in the correct field (e.g. using an EXIF editor and then instructing LR to read the updated metadata from the file)? Thanks!

I just pushed a new version of the plugin with that camera added. —Jeffrey

— comment by Richard Drdul on March 30th, 2013 at 1:02am JST (1 year, 4 months ago) comment permalink

BTW, I noticed your comment above that this isn’t a popular plugin. Maybe if you changed the name to better describe what it can do, more people would check it out. I would suggest calling it “Focal Length Calculator,” as IMO the calculator function is the key feature and the sort function is just a by-product. I like that the plugin a) will insert the focal length equivalent for cameras that don’t add it to the image, and b) will calculate the post-crop focal length. I am using it in combination with your metadata preset plugin to display the focal length equivalent and post-crop focal length in the metadata panel.

— comment by Richard Drdul on March 30th, 2013 at 1:32am JST (1 year, 4 months ago) comment permalink

Hi Jeffrey:

Thanks for the quick update to include the Ricoh GRD2. I have been using the Focal Length Sort plugin together with your Data Explorer plugin to figure out what focal lengths I typically shoot at, to help in deciding which prime lens(es) to purchase. I’m not sure yet if the plugin will save me money or prompt me to spend more. :-)

I ran into a glitch today with the plugin. I ran it on an image from a Micro 4/3 camera shot at 21 mm, and it correctly reported an equivalent FL of 42 mm. I cropped the image slightly, so it also reported a post-crop equivalent FL of 44 mm. After adjusting the image in LR, I opened it in Photoshop for some final retouching. When I later ran the Focal Length Sort plugin on the resulting TIFF file, it correctly calculated the equivalent FL as 42 mm, but calculated the post-crop FL as 42 mm also, not 44 mm as it did for the raw file. Any idea as to why it didn’t calculate the post-crop FL properly for the Photoshop image?

The trip through Photoshop removed the knowledge that the image was cropped. When you crop in Lightroom, you’re just adding a bit of metadata that you’re interested only in this sub-rectangle, but once you go through Photoshop, the crop is “baked in”, and the plugin no longer knows that it was cropped because within Lightroom, you’re seeing the whole thing. —Jeffrey

— comment by Richard Drdul on April 2nd, 2013 at 12:08am JST (1 year, 4 months ago) comment permalink

How can add more cameras to the crop-factor database?

It’s a manual process… send me the URL of the camera’s page at the manufacture and a sample image and I’ll try to add it. —Jeffrey

— comment by Art on April 30th, 2013 at 1:32pm JST (1 year, 3 months ago) comment permalink

Hi Jeffrey:

Can you add the Fujifilm XF1 to the database? The manufacturer website for the camera is http://www.fujifilm.com/products/digital_cameras/x/fujifilm_xf1/, and you can download a sample image at http://tinyurl.com/p7vns2c. Thanks!

Richard in Vancouver Canada

Sure, done. Thanks for the direct links. —Jeffrey

— comment by Richard Drdul on May 25th, 2013 at 10:29am JST (1 year, 2 months ago) comment permalink

Hi Jeffrey,

Can you add smartphones to your database? :-) With iPhone outnumbering any other camera on Flickr, smartphones may deserve better treatment with LightRoom too.

Alternatively, can you let the user add custom info to the database so they can add the crop factor for their smartphone?

The problem with many smartphones is that there are not sufficient details available to calculate the crop factor. If you’ve got some examples, please email them to me (original photos from the phone, plus details on the crop factor). —Jeffrey

— comment by Rick on November 17th, 2013 at 12:33pm JST (8 months, 8 days ago) comment permalink

Additional issue with smartphones is that since a lot of them don’t have any zoom, quite a few of them don’t store any focal information in exif. And then there are Nokia phones that that shoot at different focal lenght in 4:3 and 16:9 aspect ratios (according to specs)

So in case of some Nokia phones you have to not only check if original photo was in widescreen or not, then add what focal lenght it was then calculate 35mm equivalent

— comment by Artur on November 18th, 2013 at 12:39am JST (8 months, 8 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