{"id":692,"date":"2008-01-15T23:59:22","date_gmt":"2008-01-15T14:59:22","guid":{"rendered":"https:\/\/regex.info\/blog\/2008-01-15\/692"},"modified":"2008-01-15T23:59:22","modified_gmt":"2008-01-15T14:59:22","slug":"piglets-lightroom-plugin-extensions","status":"publish","type":"post","link":"https:\/\/regex.info\/blog\/2008-01-15\/692","title":{"rendered":"&#8220;Piglets&#8221;, Lightroom Plugin Extensions"},"content":{"rendered":"\n\n<div class='major_announce'><p>Piglets are for <span class='nobr'>Lightroom 1.<\/span>x plugins only, and are not needed in <span class='nobr'>Lightroom 2<\/span> or later.<\/p><\/div>\n\n<p>The four export plugins for Adobe Lightroom that I've written &ndash;\nfor uploading to <a class='quiet'\nhref=\"\/blog\/photo-tech\/lightroom-zenfolio\/\">Zenfolio<\/a>,\n<a class='quiet'\nhref=\"\/blog\/photo-tech\/lightroom-smugmug\/\">SmugMug<\/a>, <a\nclass='quiet'\nhref=\"\/blog\/photo-tech\/lightroom-flickr\/\">Flickr<\/a>, and\n<a class='quiet'\nhref=\"\/blog\/photo-tech\/lightroom-picasaweb\/\">Picasa\nWeb<\/a> &ndash; are useful, <span class='nobr'>I hope,<\/span> and offer lots of options and ways for\nthe user to configure how their images are processed. <span class='nobr'>If I had<\/span> more time\nand more skill, though, the plugins could do more. <span class='nobr'>So much more<\/span>.<\/p>\n\n<p>For example, Tim Armes' <a\nhref=\"http:\/\/timothyarmes.com\/lrmogrify.php\">LR\/Mogrify Lightroom Export\nPlugin<\/a> offers <span class='nobr'>a lot<\/span> of nice features that <span class='nobr'>I wish<\/span> my plugins offered, including:\n<\/p>\n<ul>\n  <li>the ability to add watermark overlays (both text <i>and<\/i> images)<\/li>\n  <li>the ability to add borders around images<\/li>\n  <li>the ability to apply output sharpening of various types<\/li>\n  <li>the ability to and convert the image to any color space you happen to have on hand.<\/li>\n  <li>the ability to do anything that ImageMagick's &#8220;mogrify&#8221; command allows, which is <a href=\"http:\/\/www.imagemagick.org\/script\/mogrify.php\"><span class='nobr'>a lot<\/span><\/a><\/li>\n<\/ul>\n\n<p class='h'>The Problem<\/p>\n\n<p>Many of these are features that Lightroom should really be providing\nitself, and <span class='nobr'>I have<\/span> no doubt some far-off version of Lightroom will provide\nthem, but just as Photoshop <span class='nobr'>Version 1.3<\/span> did not have all the features\noffered in the current version of Photoshop (<span class='nobr'>Version 10<\/span> or something like\nthat), <a href=\"\/blog\/2007-02-19\/385\"><span class='nobr'>I can<\/span> understand<\/a>\nLightroom's current situation.<\/p>\n\n<p>So, anyway, <span class='nobr'>Tim made a<\/span> plugin that does all these nice things, but these\nfeatures are not really destination-specific features: one should be able\nto invoke them with <b>any export<\/b>, including exports via my plugins.<\/p>\n\n<p class='h'>The Solution<\/p>\n\n<p>With Tim's permission, <span class='nobr'>I could<\/span> have hacked out the juicy parts of his\nplugin and grafted them to mine, which would have taken only <span class='nobr'>a few<\/span> minutes\nbecause he's already done the hard work of developing it. <span class='nobr'>But that would<\/span>\nhave been too easy, so instead, <span class='nobr'>I created<\/span> the infrastructure for normal\nplugins like mine to use fourth-party &#8220;plugin plugins&#8221; developed by\nothers.<\/p>\n\n<p>Put another way, <span class='nobr'>I built<\/span> the mechanics for Tim or anyone else to offer\ntheir own image-processing components as <span class='nobr'>a sub<\/span>-plugin to any of my plugins.\nFurthermore, this &#8220;sub-plugin infrastructure&#8221; is reusable by other\nfull-fledged plugins &ndash; not just my own &ndash; so other plugin\ndevelopers can easily expose their plugins to the benefits of the universe\nof &#8220;sub plugins&#8221; that will hopefully emerge.<\/p>\n\n<p class='h'>&#8220;Piglets&#8221;<\/p>\n\n<p>The previous two paragraphs don't flow very well because the phrases\n&#8220;plugin plugins&#8221; and &#8220;sub plugins&#8221; are just too awkward. <span class='nobr'>I came up<\/span> with <span class='nobr'>a\nnew<\/span> name to label this new technology, by following this stream of\nthought:<\/p>\n\n\n\n<div style='margin-left:4em; text-align:center; margin-right: auto; width:10em'>\n\n<b style='font-size:120%'>plugin plugin<\/b>\n<span class='downarrow'>&#8675;<\/span>\nsub plugin\n<span class='downarrow'>&#8675;<\/span>\nplugin-ette\n<span class='downarrow'>&#8675;<\/span>\npluglette\n<span class='downarrow'>&#8675;<\/span>\npiglet\n<span class='downarrow'>&#8675;<\/span>\n<span style='font-size:120%'>Piglet<\/span>\n<span class='downarrow'>&#8675;<\/span>\n<span style='font-size:170%'>Piglet<\/span>\n<span class='downarrow'>&#8675;<\/span>\n<span style='font-size:250%;' class='nobr'><span style='font-family:times'>&#8220; <\/span>Piglet<span style='font-family:times'> &#8221;<\/span><\/span>\n<\/div>\n\n<p>Okay, so I think it's cute, but you'll be forgiven if you think it's\ncorny. Nevertheless, that's the name, and so a <b>piglet<\/b> is <span class='nobr'>a plugin<\/span>\nfor one of my Lightroom export plugins, or for any plugin that uses my\npiglet infrastructure.<\/p>\n\n<p>I developed this infrastructure in consultation with Tim, and he worked\nin tandem to provide his LR\/Mogrify plugin as <span class='nobr'>a piglet<\/span> as well.<\/p>\n\n<p style='margin-bottom:0'>Just to give you an idea of what this can mean,\nhere's <span class='nobr'>a look<\/span> the export dialog from my Flickr plugin, with Tim's piglet\ninstalled and enabled. In it, notice all the new sections with &#8220;PIGLET:&#8221;\ntitles....<\/p>\n\n<div class='ic' style='margin:0'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/lr\/PigletDialogClosed.png\" width=\"741\" height=\"708\"\nclass=\"raw\"\nid=\"iPigletDialogClosed\"\nindexhint=\"bottom\"\/><\/div>\n\n<p>Now, to give a further feel for the power here, here's the same dialog\n(with just the one piglet enabled, mind you) with all the sections opened\nup. <span class='nobr'>The new sections<\/span> that come from the LR\/Mogrify piglet are outlined in\ngreen:<\/p>\n\n<div class='ic' style='margin:0'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/lr\/PigletDialogFull.png\" width=\"759\" height=\"4241\"\nclass=\"raw\"\nid=\"iPigletDialogFull\"\nindexhint=\"top\"\/><\/div>\n\n<p>Wow, that is, by far, the largest image I've ever used in <span class='nobr'>a post!<\/span> For\ncomparison, see the relatively-tiny dialog on <a class='nobr'\nhref=\"\/blog\/2007-11-20\/640\">the announcement for <span class='nobr'>Version\n1<\/span><\/a> of my Flickr plugin.<\/p>\n\n<p>The piglet (or piglets) insert their own sections into the dialog\nbetween the main plugin sections, and the final plugin-info section.<\/p>\n\n<p style='margin-bottom:0'>Notice at the very bottom of the full dialog, in the middle of the\n&#8220;Flickr Export Plugin Info&#8221; section, there's a <span class='nobr'><span\nstyle='font-family:times'>&#8220;<\/span><b>Manage plugin additions\n(&#8220;piglets&#8221;)<\/b><span style='font-family:times'>&#8221;<\/span><\/span> button.\nClicking on that brings up the Piglet Manager:\n<\/p>\n\n<div class='ic' style='margin:0'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/lr\/PigletManagerDialog.png\" width=\"620\" height=\"357\"\nclass=\"raw\"\nid=\"iPigletManagerDialog\"\nindexhint=\"top\"\/><\/div>\n\n<p style='margin-top:0'>Each piglet available to the plugin is listed\n&ndash; just one in this example &ndash; and each can be enabled or\ndisabled by checking or clearing the checkbox.<\/p>\n\n<p>Piglets that are not enabled do not show up at all in the plugin export\ndialog, as if they did not exist. <span class='nobr'>To enable<\/span> <span class='nobr'>a piglet,<\/span> check its box, then\nrestart Lightroom.<\/p>\n\n<p>By the way, and wholly unrelated to this enabling\/disabling of piglets\nat the main plugin level, note that <span class='nobr'>a piglet<\/span> can contain a &#8220;disable me&#8221;\nfeature, such as LR\/Mogrify does (as seen in the first checkbox in the\ngreen-highlighted section of the full dialog screenshot shown above). This\nis simply <span class='nobr'>a convenient<\/span> way for <span class='nobr'>a piglet<\/span> to let you turn its features on and\noff for <span class='nobr'>a specific<\/span> export.<\/p>\n\n<p class='h'>The Down Side: Piglet Maintenance<\/p>\n\n<p>It's been a daunting task to get all this to work with the limited\nfeatures provided by the initial beta release of the API found in <span class='nobr'>Lightroom\n1.3,<\/span> and one result is that installing piglets is not as smooth as I'd\nlike.<\/p>\n\n<p>A piglet can be as simple as a single <tt>*.piglet<\/tt> file, or more complex. Tim's\nLR\/Mogrify piglet is delivered as three files (one <tt>*.piglet<\/tt> file,\nand two images used in the UI). <span class='nobr'>In any case<\/span>, installing <span class='nobr'>a piglet<\/span> is as\nsimple as copying the file or files to the plugin folder, but there are caveats:<\/p>\n\n<ul>\n  <li><p>If you use multiple plugins (say, both my Flickr and Zenfolio plugins), you need to copy\n       <span class='nobr'>a piglet's<\/span> files to both if you want to use <span class='nobr'>a piglet<\/span> in both.<\/p><\/li>\n\n  <li><p>If you're not sure where to find <span class='nobr'>a plugin's<\/span> folder, revisit the\n       <a href=\"\/blog\/2007-11-17\/638\">plugin install instructions<\/a> for <span class='nobr'>a list<\/span> of likely locations\n       to find the per-plugin <tt>*.lrplugin<\/tt> or\n       <tt>*.lrdevplugin<\/tt> folders.<\/p>\n\n       <p>On a Mac, if the plugin is named with <tt>*.lrplugin<\/tt>, before you can copy files into it\n       with Finder, you must Ctrl-Click on it and choose &#8220;Show package contents&#8221;.\n       (This is not required to copy files from within Terminal.)<\/p><\/li>\n\n  <li><p>After installing a piglet by copying files, you can then invoke the piglet manager to enable the piglet. You'll have to restart\n       Lightroom for it to take effect. Sorry.<\/p><\/li>\n\n  <li><p>If you upgrade the plugin, replacing it with <span class='nobr'>a new<\/span> version, you\n      must remember to re-copy your piglet file(s) to the new plugin\n      folder.<\/p>\n\n       <p>Each. &nbsp; Time. &nbsp; You. &nbsp; Upgrade.<\/p>\n\n       <p>Ugh. At least, you don't have to revisit\n      the piglet manager to enable the plugin; that's required only the first\n      time, or if you want to re-enable <span class='nobr'>a piglet<\/span> after having disabled\n      it.<\/p><\/li>\n\n  <li><p><span style='color:#F55'>BE SURE TO KEEP <span class='nobr'>A COPY<\/span> OF YOUR PIGLETS SO THAT\n      YOU CAN REPOPULATE YOUR PLUGINS WHEN YOU UPGRADE THEM.<\/span> This is\n      perhaps not so vital for <span class='nobr'>a free<\/span> piglet that you can always\n      go and re-download, but it's vital for any piglet that you've paid\n      for.<\/p><\/li>\n\n<\/ul>\n\n<p>This may be starting to sound like <span class='nobr'>a hassle,<\/span> because it is. Luckily, this\nhassle comes into play only when upgrading.<\/p>\n\n<!--TECH-->\n<div class=\"robots-nocontent\" style=\"border: 2px solid #FF8080;\n            float: right;\n            padding: 0 1em 1em 1em;\n            margin: 10px 0 1em 1em;\n            display: inline;\">\n<p style='white-space: nowrap'><b>My Tech-Related Photography Posts<\/b><\/p>\n<ul style='margin:0; font-size:80%'>\n  <li><a href='\/blog\/lightroom-goodies\/ipad-howto2'>My Lightroom-to-iPad Workflow<\/a><\/li>\n  <li><a href='\/blog\/lightroom-goodies\/'>Lightroom Goodies<\/a> (lots of plugins)<\/li>\n  <li><a href='\/blog\/photo-tech\/color-spaces-page1\/'>Digital Image Color Spaces<\/a><\/li>\n  <li><a href='\/blog\/other-writings\/online-exif-image-data-viewer\/'>Online Exif (Image Data) Viewer<\/a><\/li>\n  <li><a href='\/blog\/photo-tech\/focus-chart\/'>Jeffrey's Autofocus Test Chart<\/a><\/li>\n  <li><a href='\/blog\/photo-tech\/calendar\/'>Photoshop Calendar-Template-Building Script<\/a><\/li>\n  <li><a href='\/blog\/lightroom-goodies\/ipad-howto'>How to Prepare Photos for an iPad<\/a><\/li>\n  <li><a href='\/blog\/photo-tech\/nef-compression\/'>A Qualitative Analysis of NEF Compression<\/a><\/li>\n  <li><a href='\/blog\/2007-08-24\/554'>Tripod Stability Tests<\/a><\/li>\n<\/ul>\n<p style='font-size:85%; margin:10px 0 0 0'><a href=\"\/blog\/photo-tech\/\">more<\/a>...<\/p>\n<\/div>\n<!--\/TECH-->\n\n\n<p class='h'>Getting Piglets<\/p>\n\n<p>See my <a href=\"\/blog\/photo-tech\/piglets\/\">Piglets\nPage<\/a> for <span class='nobr'>a list<\/span> of piglets that <span class='nobr'>I know<\/span> about, and how to get them.<\/p>\n\n<p class='h'>Thanks<\/p>\n\n<p>Building all this was a fairly lengthy process, made longer by the\nnew-year's break and my having caught <span class='nobr'>a cold<\/span> (that <span class='nobr'>I still<\/span> have... ugh).\nThroughout, <a href=\"http:\/\/timothyarmes.com\/\">Tim Armes<\/a> and <a\nhref=\"http:\/\/www.utiliser-lightroom.fr\">Gilles Theophile<\/a> worked\npatiently and tirelessly with me to get everything working and all the\npieces into place.<\/p>\n\n<p>I should also thank Gilles for his work in providing the French\ntranslations for all my plugins (and for Tim's plugins and piglets as\nwell). Even if you don't read French, users of Lightroom will appreciate\nthe design of <a href=\"http:\/\/www.utiliser-lightroom.fr\">Gilles' Lightroom\nsite<\/a>.<\/p>\n\n<p>I'd also like to thank <a href=\"http:\/\/10fathoms.org\/vu\">Andrei\nZmievski<\/a> and Brien Wankel for debugging assistance.<\/p>\n\n\n<style type=\"text\/css\">\n#post692 .h { font-size: 120%; font-weight: bold }\n#post692 .downarrow { display: block; font-size:200%; margin:0 }\n<\/style>\n\n\n","protected":false},"excerpt":{"rendered":"<p>Piglets are for Lightroom 1.x plugins only, and are not needed in Lightroom 2 or later.<\/p> <p>The four export plugins for Adobe Lightroom that I've written &ndash; for uploading to Zenfolio, SmugMug, Flickr, and Picasa Web &ndash; 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.<\/p> <p>For example, Tim Armes' LR\/Mogrify Lightroom Export Plugin offers a lot of nice features that I wish my plugins offered, including: <\/p> the ability to [...]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,1,13],"tags":[],"_links":{"self":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/posts\/692"}],"collection":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/comments?post=692"}],"version-history":[{"count":0,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/posts\/692\/revisions"}],"wp:attachment":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/media?parent=692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/categories?post=692"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/tags?post=692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}