“Piglets”, Lightroom Plugin Extensions

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

The Problem

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.

The Solution

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.

“Piglets”

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:

plugin plugin sub plugin plugin-ette pluglette piglet Piglet Piglet Piglet

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.

Getting Piglets

See my Piglets Page for a list of piglets that I know about, and how to get them.

Thanks

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.


The 30 most-recent comments (out of 39; see all), most recent last...

Wow, thanks so much Jeffrey, for this great addition! I had no problem installing and running the LR/Modify Plugin and now I can add a watermark using a color and size of my choosing. This is a real timesaver, considering that I had to use Photoshop previously. Now I can skip that step entirely. Hooray!!
And I love the name “piglet” too.

— comment by Betty on January 17th, 2008 at 8:35am JST (16 years, 3 months ago) comment permalink

please contact me. am getting LR crash on plugin. have screenshots and would like to debug with your help. just started with xx.29 release. thankyou

— comment by Stephen on January 20th, 2008 at 10:16am JST (16 years, 3 months ago) comment permalink

I’m having the same issue as polina above. Copying the LR/Mogrify piglet into either the Zenfolio or Flickr plugin packages does not cause them to be available in the lightroom export dialog. I’ve tried maintaining the piglet folder layout as well as copying all of the files directly into the .lrplugin package. Clicking the Manage Piglets button says no piglets are available. Using both the latest (downloaded today, 2008-01-20) versions of all plugins.

I’m looking forward to having the features of both plugins available during a single export.

Thanks!

— comment by Jack BAty on January 21st, 2008 at 4:24am JST (16 years, 3 months ago) comment permalink

Hi from France,

Thanks for this nice Picasa export plugin. It saves so much time :-).

— comment by Fred on February 2nd, 2008 at 10:46pm JST (16 years, 3 months ago) comment permalink

Will you be creating this for the Mac by any chance? If not, do you know of someone that has a similar plugin?

All my Lightroom stuff, including my plugins, work fine on a Mac. —Jeffrey

— comment by Andre Fortier on February 4th, 2008 at 8:10am JST (16 years, 2 months ago) comment permalink

Thanks. Works great.

— comment by Andre Fortier on February 4th, 2008 at 5:13pm JST (16 years, 2 months ago) comment permalink

I dont understand this at all. Isn’t there supposed to be a piglet file to install?

— comment by jasper on February 10th, 2008 at 2:55pm JST (16 years, 2 months ago) comment permalink

The Piglet file is on the Piglet page, you install it separately for each plugin… yes this sucks, but it works.

— comment by Sean McCormack on February 10th, 2008 at 5:14pm JST (16 years, 2 months ago) comment permalink

Hi,

It seems that I’m again running into problems with a user account that has “ä” letter in it… the Piglet manager seems to be unable to run “dir /b etc.” command as lightroom SDK can not hande (windows XP) file paths that have scandinavian characters in them 🙁

Does anyone have any workaround in that? (renaming users is not an option, unfortunately).

Regards,
/KPa

— comment by KPa on February 11th, 2008 at 12:23am JST (16 years, 2 months ago) comment permalink

I’m also having problems with spanish characters like óá… (Spanish XP system folders use them)
“Local configuration” is “Configuración Local” in Spanish, so the plugin cannot execute the piglet with this folder as a parameter.

David

— comment by David on February 21st, 2008 at 8:44pm JST (16 years, 2 months ago) comment permalink

How does the module know if something has been uploaded to flickr or not for the “refresh” settings? I have several pics that are on flickr that I want to refresh but I can’t seem to get it to match up. Do I have to make the file names match? Delete them from flickr and reupload (gulp) or …..

Thanks!

At this point, “delete and reupload” because the plugin currently knows only about images that it has uploaded.

If there’s a way to match things up otherwise (e.g. via filename) I could try to build something, but I worry that it’s not very clearcut for most people’s photos… —Jeffrey

— comment by John on March 4th, 2008 at 3:59pm JST (16 years, 1 month ago) comment permalink

I think we need a better manual. This is giving me a headache!

I suggest you demand a full refund. :-/ —Jeffrey

— comment by Dmitri on March 7th, 2008 at 10:12am JST (16 years, 1 month ago) comment permalink

Hi,
I have a problem.
I use the piglet for: Mogrify -> upload to picasa, but it’s not working (but it worked once).
I see this 3 error messages.
———-
Warning

Failed to run Mogrify, aborting export

Faild to raun Mogrify wih following command line:
“my_path_to_\mogrify.exe” -virtual-pixel mirror -format jpg -quality 85 “E:\Dokumente und Einstellungen\sebas\Lokale Einstellungen\Temp\20071021-IMG_0554bsharp021.tif”
—–
Warning

Runtime error in “Timothy Armes’ LR/Mogrify Piglet” piglet in startOfOneRender().
Piglet Disabled

LRMogrify.piglet:1915: canceled

——-
Warning

Upload Failure

One image failed to upload
——–

I tested the mogrify command with the command line and it works.
Can anyone help me with this?

Thank you.
Sebastian

You should probably contact the author of the Mogrify piglet for this. —Jeffrey

— comment by Sebastian Fingerhuth on March 9th, 2008 at 6:40am JST (16 years, 1 month ago) comment permalink

I have been happily using the AnyCommand, Export to Flickr and LR/Mogrify piglets for a couple of weeks now. I love them, and have come to rely on them in my workflow.

Unfortunately, it appears the recently released Lightroom v1.4 breaks something in the piglet framework. All my presets that use piglets now result in “This plugin is not installed on your computer or is not functioning properly.” appearing in the export dialog. Trying to create a new preset gives the same result.

…Mike

You need new versions of the plugins, or, downgrade to 1.3.1 until the bugs with 1.4 are sorted out. See this post for more info on both fronts. —Jeffrey

— comment by Mike Alexander on March 16th, 2008 at 11:08pm JST (16 years, 1 month ago) comment permalink

Dude. Your Grandma comments on your blog?

That’s awesome.

For the record, she’s my son’s grandma (that is, my mom), but until last year knew less about computers/internet than most people’s long-passed great-great-great grandparents. Now, she even does IM! —Jeffrey

— comment by Yuletide on April 10th, 2008 at 9:27am JST (16 years ago) comment permalink

Thanks so much for making the Mogrify piglet. I’m having a bit of a problem though with enabling it and wonder if you or anyone here could offer some ideas for a fix?

For some reason in the piglet-Mogrify configuration box there is no enable LR /Mogrify Piglet check box as is shown in the image included in your post. The path is mapped correctly to the Mogrify application. Result of this being none of the Mogrify options show up in their respective drop down sections. The boxes are completely empty.

The contents of the Mogrify piglet are copied to the flickr-jfriedl plugin folder. The Mogrify piglet is enabled in the piglet manager.

Though I think it’s of little relevance the run any command piglet is enabled. I’ve tried switching the order of priority of the two piglets but that makes no difference. I’ve also tried the Mogrify piglet with the run any command piglet disabled but again no difference.

I have the Mogrify stand alone plug in as well which works fine. I’ve tried the Mogrify piglet after removing the stand alone plug in from modules though no big surprise that made no difference either. I’ve also deleted all modules and replaced them with newly downloaded versions. Again makes no difference.

I’m using LR 1.4.1. I’d really like to use the integrated functionality of the Mogrify piglet with the LR plug in and hope very much that a solution is out there to the problem I’ve described.

Thanks to you or anyone else that can offer some help.

— comment by Alex on May 12th, 2008 at 1:02am JST (15 years, 11 months ago) comment permalink

Just after I posted the message above I realised you never made the piglet in question – oops!

I’ve got in touch with Timothy. Maybe though you are anyone else here might be able to help anyway. Whatever, thanks your Flickr LR plug in which has always worked on it’s own with no problem (other than the FormatMessageW failed error). Cheers.

— comment by Alex on May 12th, 2008 at 1:15am JST (15 years, 11 months ago) comment permalink

Howdy

Using a Mac 10.5.3, LR 1.4.1, I can only select either your plugin or Mr. Armes, when I select the “manage plugins” on your plug-in I do not see his, just your advanced one. Is this a windoz thing ( integration ), I have a screen shot from column view,MODULES| *.lrplugin ( 2, his & yours ) Piglet folder| All the parts of Mr. Armes “morgify” ( 2 png, extras folder, “.piglet” document.

Help ( clarification, or duh windoz thing )

Terence

— comment by Terence Dodge on June 7th, 2008 at 6:20am JST (15 years, 10 months ago) comment permalink

Those who need to add watermark to their images when exporting with a plugin of Jeffrey’s may use ImageMagick’s morgify command directly instead of LR/Morgify.

Download and install ImageMagick suite, then use Jeffrey’s ‘Run Any Command’ piglet with this command:

"c:\path\to\morgify.exe" -draw 'image Overlay 0,0 0,0 "d:\path\to\watermark.png"' -gravity SouthWest "{FILE}"

The command draws ‘watermark.png’ over the exported image in ‘overlay’ blending mode and in its lower left part. For details on positioning and blending mode check - gravity and - draw options in ImageMagick’s Command-line Options.

— comment by Grzegorz on June 8th, 2008 at 10:36pm JST (15 years, 10 months ago) comment permalink

Hi Jeffrey,

A million thanks to you for providing all of these fantastic plugins.

I just tried installing the LR Mogrify plugin and I’m having some trouble making it play nice with your FlickrExport plugin.

I get this error message:
Failed to run Mogrify with the following command line:
“/Volumes/Local/Users/switters/Library/Application Support/Adobe/Lightroom/Modules/flickr-jfriedl.lrplugin/LRMogrify.extras/mogrify” -virtual-pixel mirror -resize “1000x” -sharpen 0x1.00 -bordercolor “rgb(100%,100%,100%)” -border 3×3 -bordercolor “rgb(0%,0%,0%)” -border 20×20 -format jpg -quality 95 “/var/folders/IX/IXzlijykG0uGmMaBKnukHk+++TM/-Tmp-/7EB8B875-0FFF-4E03-AEED-D582E2E317DF/_IGP0701.tif”

Followed by:
Runtime error in “Timothy Armes’ LR/Mogrify Piglet” piglet in startOfOneRender().
Piglet Disabled.
LRMogrify.piglet:1926: canceled

I am able to export to disk using LRMogrify without a problem.

Here’s how I installed LRMogrify for FlickrExport. I located the FlickrExport plugin, clicked “show package contents” (I’m on a Mac) and then dragged the piglet file and the two PNGs into the package. Is that right?

Thanks again for your help.

— comment by Chris Kresser on June 11th, 2008 at 3:02am JST (15 years, 10 months ago) comment permalink

Jeffrey,

The above error message was with 1.4.1.

In LR 2.0 when I click “enable plugin extensions” in your FlickrExport plugin, I get the following error message:

Access to undefined global: titleColor

Once again, as far as I can tell the piglet files are installed in the correct place.

— comment by Chris Kresser on June 11th, 2008 at 11:48am JST (15 years, 10 months ago) comment permalink

Is anyone else experiencing the problem I mentioned in the above two posts?

I’d love to be able to use LRMogrify with FlickrExport, but right now it is impossible on my machine at least. I’m fairly certain I’ve followed the installation instructions.

???

— comment by Chris Kresser on June 12th, 2008 at 11:14pm JST (15 years, 10 months ago) comment permalink

Hi,

I have solution for KPa and David with their user name with scandinavian resp. spanish characters.

You can use folder “Modules” in root folder of Lightroom (for example “C:\Program Files\Adobe\Adobe Photoshop Lightroom 1.4\Modules”) instead of “\Documents and Settings\username\Application Data\Adobe\Lightroom\Modules\”

It works fine with Lightroom 1.4 (Windows XP) with Czech characters.

Vladimír

— comment by Vladimír Richter on June 15th, 2008 at 12:49am JST (15 years, 10 months ago) comment permalink

Chris Kresser: I was having the same problem that you had with “Access to undefined global: titleColor”

I fixed it by changing something in piglet_manager.lua

Find the following line:
text_color = titleColor
Replace it with this line:
text_color = nil

Reload the module and you should be able to update to the site.

Enjoy,

ArazPhoto.com

— comment by Araz on June 18th, 2008 at 2:25pm JST (15 years, 10 months ago) comment permalink

Hi, my name is Pablo Gonzalez and I’m writing from Santiago, Chile.

How can I put on a watermark on my photos?

I’m using Lightroom Export Plugin for Flickr, and I was trying LR/Mogrify, but I can do it…

I just want to use LR and export my photos to a disk or/and to Flicrk but with a watermark, it’s possible???

I hope that you can help me.
Thanks a lot

Check the “Add Copyright Watermark” box in the “Image Settings” section of the Export dialog. Be sure to have the Copyright watermark set, of course. —Jeffrey

— comment by Pablo on June 24th, 2008 at 7:57am JST (15 years, 10 months ago) comment permalink

I have the same problem than Chris Kresser

I get this error message:
Failed to run Mogrify with the following command line:
“/Volumes/Local/Users/switters/Library/Application Support/Adobe/Lightroom/Modules/flickr-jfriedl.lrplugin/LRMogrify.extras/mogrify” -virtual-pixel mirror -resize “1000x” -sharpen 0×1.00 -bordercolor “rgb(100%,100%,100%)” -border 3×3 -bordercolor “rgb(0%,0%,0%)” -border 20×20 -format jpg -quality 95 “/var/folders/IX/IXzlijykG0uGmMaBKnukHk+++TM/-Tmp-/7EB8B875-0FFF-4E03-AEED-D582E2E317DF/_IGP0701.tif”

Followed by:
Runtime error in “Timothy Armes’ LR/Mogrify Piglet” piglet in startOfOneRender().
Piglet Disabled.
LRMogrify.piglet:1926: canceled

I am able to export to disk using LRMogrify without a problem.

Since I’ve VISTA, it was perfect on my old XP computer …
mogrify plugin work separetly
Same with LR 1.3.1 and LR 1.4

— comment by David on July 15th, 2008 at 2:58am JST (15 years, 9 months ago) comment permalink

Jeffrey,
I saw on another blog a comment made by you that you were developing a plugin for Photoshop Express. Can you give an estimate on when that might be complete and if it will be available for LR 1.4?

— comment by Josh Bast on September 14th, 2008 at 5:00am JST (15 years, 7 months ago) comment permalink

I have installed the Mogrify piglet per the instructions, and done all the steps, but can not seem to get the ‘Enable Piglet’ button in the export menu. It doesn’t show the Piglet in the menu, nor does it give me the option to enable it. The piglet is in the folder for the Flickr plugin, as the instructions stated. I’m not sure how to get the Piglet Manager to launch to activate the piglet. I’m running Lightroom 2.1. I have Tim’s Mogrify export working, and I have ImageMagick running, so I have all of the needed pieces, it’s just not working together as it should. Any suggestions/input on what to do? I’d love to get this running!

Piglets are something for Lightroom 1.x only, and are not needed inLightroom 2.x (and hence aren’t supported). Use the Lightroom 2 versions of the plugins (and the Lightroom 2 versions of the instructions) and things willwork much more smoothly than they ever could have in Lightroom 1. —Jeffrey

— comment by CKimball on November 10th, 2008 at 2:20pm JST (15 years, 5 months ago) comment permalink

So then there is no Morgrify option for LR2 with the Flickr export? Thanks, that clears things up….

There is, from the same author who wrote the LR1 Mogrify piglet, but now it’s called
LR2/Mogrify. —Jeffrey

— comment by CKimball on November 10th, 2008 at 11:01pm JST (15 years, 5 months ago) comment permalink

thanks Vladimír Richter, I had the same problem that David and KPa

— comment by Jose M on January 14th, 2009 at 10:31pm JST (15 years, 3 months 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.

IMPORTANT:I'm mostly retired, so I don't check comments often anymore, sorry.


You can use basic HTML; be sure to close tags properly.

Subscribe without commenting