megapixel-sort-20100829.16.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 need that some pro photographers have, which is the ability to sort images by their megapixel size, even after cropping.
As shipped, Lightroom does have a “Megapixels” metadata item that is normally hidden, although it can be viewed by adding it to a metadata-viewer preset (such as with my Metadata-Viewer Preset Builder plugin). Unfortunately, that reflects the pixel size of the original image, not taking into account any crop that might have been applied. And even then, it's not among the items one can sort on, or even select via the Library Grid's Library Filter
|
Possible values for the
Megapixel Range custom metadata item | ||
| not yet computed | ||
| < 0.5 MP | ||
| 0.5 MP | - | 0.99 MP |
| 1 MP | - | 1.99 MP |
| 2 MP | - | 3.99 MP |
| 4 MP | - | 5.99 MP |
| 6 MP | - | 7.99 MP |
| 8 MP | - | 11.99 MP |
| 12 MP | - | 15.99 MP |
| 16 MP | - | 23.99 MP |
| 24 MP | - | 31.99 MP |
| 32 MP | - | 47.99 MP |
| 47 MP | - | 63.99 MP |
| 64 MP | - | 99.99 MP |
| 100 MP | - | 199.99 MP |
| 200 MP | - | 349.99 MP |
| 350 MP | - | 499.99 MP |
| > 500 MP | ||
Custom Metadata
This plugin creates two custom metadata items for each image it is applied to. The first, “Cropped Megapixels”, has values like “12.05 MP”. The second, and “Megapixel Range”, has one of the values listed in the box at right.
Once this data has been calculated for each image (see below), it can be viewed via the “All Plug-in Metadata” preset in the Metadata panel of the Library Module.
Calculating and Recalculating
Unfortunately, the Lightroom plugin infrastructure does not yet allow for custom metadata to be created and updated automatically, so you must explicitly tell the plugin to calculate the custom metadata.
So, this plugin adds two items to the File > Plug-in Extras menu, “Calculate Megapixels” and “Calculate Megapixels 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.
The plugin has no way of knowing when you make a cropping adjustment to an image, so you must remember to reapply the plugin to any images whose crop you change. That's a real hassle, and perhaps some future version of Lightroom will alleviate this burdensome requirement.
Still, even on my sort-of-old computer at home, the plugin can recalculate the data for my entire 45,000-image catalog in only about 30 seconds, so it's not that bad to just redo everything. Note that it's much more efficient to use “Calculate Megapixels for Entire Catalog” than selecting every image in the catalog and invoking “Calculate Megapixels”.
“Sorting” By Megapixel Size
You can't actually sort via megapixel size, 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 “Megapixel Range”. You should then be presented with a list of the range items that apply to the currently-visible images. If they all have the same crop, they'll all be within one range, and so only one value will display. But if their image sizes or crop sizes put them into different ranges, multiple lines will show.
You can then click on one of the lines 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.
| 20100829.16 | Made the revalidation process much simpler, doing away with the silly need for a revalidation file. |
| 20100820.15 | 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. |
| 20100625.14 | Yikes, shaking out some more build issues. |
| 20100624.13 | Discovered a nasty build bug; pushing a new version in case it affects this plugin. |
| 20100609.12 | 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. |
| 20100315.11 | 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. Wholesale changes that attempt to honor the user's locale settings for numeric display (e.g. Europeans writing 3,14156 for pi). I've probably missed some spots, so let me know if you find some. |
| 20091214.10 | Broke out the “< 0.5 MP” item into two, “< 0.1 MP” and “< 0.1 - 0.49 MP”. The change is not immediately reflected in photos that were processed earlier, so if you're interested in the new slice, you'll want to recompute MP for ones currently marked “< 0.5 MP”, or just recompute for your whole library. |
| 20091205.9 | Minor internal debugging tweaks. |
| 20091022.8 | Added a first draft of some rudimentary support for Lightroom 3 Beta. See this important note about plugin support in Lightroom 3 Beta and Lightroom 3, including future plans for features and my registration system. |
| 20090802.7 | Sigh, I shouldn't try to program while on vacation... the previous version was totoally broken. Trying again. |
| 20090801.6 | It seems that Lightroom reports that some images have no size (which makes no sense, of course), so I've added more debugging stuff to the log for these cases... |
| 20090801.5 | Corrects a few misspellings. |
| 20090703.4 | Expanded the upper end of the range from “> 64 MB” to “> 500 MP” to accommodate the fact that Lightroom can handle images up to 512 megapixels. Enhanced the one-click upgrade stuff quite a bit, now detecting ahead of time when it will fail because the plugin is installed where Lightroom can't write (if Lightroom can't write to it, it can't update itself). I also added a progress bar, and now download in smaller chunks to avoid 'out of memory' errors on the larger plugins. Do remember that this new functionality becomes available after you upgrade to or past this version, when you then upgrade with it. |
| 20090521.3 | Fixed a "loadstring" error some users got. |
| 20090510.2 | Added a link in the Plugin Manager to the plugin's update-log RSS feed. |
| 20090428.1 | First public release. |
Hello, interesting plugin, do you think one that allow sorting by focal length would be possible as well? I find that lack in LR annoying (I even mentioned it on the Adobe forum…).
Cheers and thanks!
As Ollivier Robert suggested, it would really be usefull to allow sorting by focal length. It would then be possible to create Smart collections with different groups of focal lenghts. like 40mm, … or even tele, wide, …
The problem is that compact camera’s tend to record the compact focal length, so a 7mm would be in reality a 28mm for a 35mm camera. The 35mm equivalent should be then calculated one way or another. I believe there is an exif attribute holding the 35mm equivalent but I’m not sure.
Yes, I agree focal length filter/sorter would be a very useful.
Another vote for the Focal Length. Having just got a Leica M8 I really want to be able to filter based on the lens I used.
regards from the Stockholm archipelago.
I can`t find how to get the cropped dimensions in lightroom SDK API. How did you managed?
Thank you
local size = photo:getRawMetadata('croppedDimensions') —Jeffrey
Thanks a lot for the answer. It works fine. I don’t understand why it is not on the SDK documentation. Is there any additional source of information?
There’s a Lightroom SDK forum over at Adobe as well. —Jeffrey
I need to be able to determine the UNCOMPRESSED size of a JPEG file.
My stock agency requires the JPEG, when opened in Photoshop or any other application, to be at least 48MB in file size. Is it possible to make a plugin that would calculate this?
For example, one of my JPEG files is caclulated by your plugin to be 12.1 Megapixels. The JPEG is 7.6MB. Opened in Photoshop, it’s 34.4MB.
The only two image editing programs that I know to give me this data are ACDSee Pro 3 and Photoshop. Sure would be nice to see it in Lightroom.
Alan
I don’t see how you’re getting 34.4MB from 12.1 MP (2.8 bytes/pixel?), but you can upsize on export to meet arbitrary size requirements. Tim Armes’ LR2/Mogrify plugin has some options to do this automatically. —Jeffrey