Piglets are for Lightroom 1.x plugins only, and are not needed in Lightroom 2 or later.
The four export plugins for Adobe Lightroom that I've written – for uploading to Zenfolio, SmugMug, Flickr, and Picasa Web – are useful, I hope, and offer lots of options and ways for the user to configure how their images are processed. If I had more time and more skill, though, the plugins could do more. So much more.
For example, Tim Armes' LR/Mogrify Lightroom Export Plugin offers a lot of nice features that I wish my plugins offered, including:
- the ability to add watermark overlays (both text and images)
- the ability to add borders around images
- the ability to apply output sharpening of various types
- the ability to and convert the image to any color space you happen to have on hand.
- the ability to do anything that ImageMagick's “mogrify” command allows, which is a lot
Many of these are features that Lightroom should really be providing itself, and I have no doubt some far-off version of Lightroom will provide them, but just as Photoshop Version 1.3 did not have all the features offered in the current version of Photoshop (Version 10 or something like that), I can understand Lightroom's current situation.
So, anyway, Tim made a plugin that does all these nice things, but these features are not really destination-specific features: one should be able to invoke them with any export, including exports via my plugins.
With Tim's permission, I could have hacked out the juicy parts of his plugin and grafted them to mine, which would have taken only a few minutes because he's already done the hard work of developing it. But that would have been too easy, so instead, I created the infrastructure for normal plugins like mine to use fourth-party “plugin plugins” developed by others.
Put another way, I built the mechanics for Tim or anyone else to offer their own image-processing components as a sub-plugin to any of my plugins. Furthermore, this “sub-plugin infrastructure” is reusable by other full-fledged plugins – not just my own – so other plugin developers can easily expose their plugins to the benefits of the universe of “sub plugins” that will hopefully emerge.
The previous two paragraphs don't flow very well because the phrases “plugin plugins” and “sub plugins” are just too awkward. I came up with a new name to label this new technology, by following this stream of thought:
Okay, so I think it's cute, but you'll be forgiven if you think it's corny. Nevertheless, that's the name, and so a piglet is a plugin for one of my Lightroom export plugins, or for any plugin that uses my piglet infrastructure.
I developed this infrastructure in consultation with Tim, and he worked in tandem to provide his LR/Mogrify plugin as a piglet as well.
Just to give you an idea of what this can mean, here's a look the export dialog from my Flickr plugin, with Tim's piglet installed and enabled. In it, notice all the new sections with “PIGLET:” titles....
Now, to give a further feel for the power here, here's the same dialog (with just the one piglet enabled, mind you) with all the sections opened up. The new sections that come from the LR/Mogrify piglet are outlined in green:
Wow, that is, by far, the largest image I've ever used in a post! For comparison, see the relatively-tiny dialog on the announcement for Version 1 of my Flickr plugin.
The piglet (or piglets) insert their own sections into the dialog between the main plugin sections, and the final plugin-info section.
Notice at the very bottom of the full dialog, in the middle of the “Flickr Export Plugin Info” section, there's a “Manage plugin additions (“piglets”)” button. Clicking on that brings up the Piglet Manager:
Each piglet available to the plugin is listed – just one in this example – and each can be enabled or disabled by checking or clearing the checkbox.
Piglets that are not enabled do not show up at all in the plugin export dialog, as if they did not exist. To enable a piglet, check its box, then restart Lightroom.
By the way, and wholly unrelated to this enabling/disabling of piglets at the main plugin level, note that a piglet can contain a “disable me” feature, such as LR/Mogrify does (as seen in the first checkbox in the green-highlighted section of the full dialog screenshot shown above). This is simply a convenient way for a piglet to let you turn its features on and off for a specific export.
The Down Side: Piglet Maintenance
It's been a daunting task to get all this to work with the limited features provided by the initial beta release of the API found in Lightroom 1.3, and one result is that installing piglets is not as smooth as I'd like.
A piglet can be as simple as a single *.piglet file, or more complex. Tim's LR/Mogrify piglet is delivered as three files (one *.piglet file, and two images used in the UI). In any case, installing a piglet is as simple as copying the file or files to the plugin folder, but there are caveats:
If you use multiple plugins (say, both my Flickr and Zenfolio plugins), you need to copy a piglet's files to both if you want to use a piglet in both.
If you're not sure where to find a plugin's folder, revisit the plugin install instructions for a list of likely locations to find the per-plugin *.lrplugin or *.lrdevplugin folders.
On a Mac, if the plugin is named with *.lrplugin, before you can copy files into it with Finder, you must Ctrl-Click on it and choose “Show package contents”. (This is not required to copy files from within Terminal.)
After installing a piglet by copying files, you can then invoke the piglet manager to enable the piglet. You'll have to restart Lightroom for it to take effect. Sorry.
If you upgrade the plugin, replacing it with a new version, you must remember to re-copy your piglet file(s) to the new plugin folder.
Each. Time. You. Upgrade.
Ugh. At least, you don't have to revisit the piglet manager to enable the plugin; that's required only the first time, or if you want to re-enable a piglet after having disabled it.
BE SURE TO KEEP A COPY OF YOUR PIGLETS SO THAT YOU CAN REPOPULATE YOUR PLUGINS WHEN YOU UPGRADE THEM. This is perhaps not so vital for a free piglet that you can always go and re-download, but it's vital for any piglet that you've paid for.
This may be starting to sound like a hassle, because it is. Luckily, this hassle comes into play only when upgrading.
See my Piglets Page for a list of piglets that I know about, and how to get them.
Building all this was a fairly lengthy process, made longer by the new-year's break and my having caught a cold (that I still have... ugh). Throughout, Tim Armes and Gilles Theophile worked patiently and tirelessly with me to get everything working and all the pieces into place.
I should also thank Gilles for his work in providing the French translations for all my plugins (and for Tim's plugins and piglets as well). Even if you don't read French, users of Lightroom will appreciate the design of Gilles' Lightroom site.
I'd also like to thank Andrei Zmievski and Brien Wankel for debugging assistance.