Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Have things advanced in Lightroom to support access to custom metadata in a web gallery plugin? @Blatman888, I have tried to understand the workflow in fixup.txt, but with no luck. Are there sample plugins that can be reviewed?
I recently posted this question on stackexchange looking for help:
lua - In Lightroom how do you reference custom metadata in a web plugin? - Stack Overflow
Thanks,
Craig
Copy link to clipboard
Copied
No.
Copy link to clipboard
Copied
Have things advanced in Lightroom to support access to custom metadata in a web gallery plugin?
I don't totally understand the web engine, but I was able to modify the SDK example "mysample.lrwebengine" to show another plugin's custom metadata field underneath the image shown on "large.html". The basic idea is to map the image proxy returned by getImage(index) to its corresponding LrPhoto in the catalog, using the image proxy's "imageID" property. That "imageID" property is the the same as the underlying photo's "localIdentifier" property. Once you have an LrPhoto, you can use the photo:getPropertyForPlugin() method to retrieve the custom metadata field for any plugin.
Here's a modified version of "large.html" that displays the metadata field "file" of the plugin "com.johnrellis.anyfile" underneath the image:
<%
--[[ Define some variables to make locating other resources easier.]]
local image = getImage( index )
local theRoot = ".."
local others = "."
local mySize = "large"
--[[ Code added by John R. Ellis ]]
local LrApplication = import 'LrApplication'
local catalog = LrApplication.activeCatalog ()
local idToPhoto = {}
for _, photo in ipairs (catalog:getAllPhotos ()) do
idToPhoto [photo.localIdentifier] = photo
end
local photo = idToPhoto [image.imageID]
local anyfileFile = photo:getPropertyForPlugin ("com.johnrellis.anyfile", "file")
--[[ End code added by John R. Ellis ]]
%>
<% --[[ Include the page header]] %>
<%@ include file="header.html" %>
<div>
<ul>
<lr:Pagination>
<lr:PreviousEnabled>
<li><a href="$link">Previous</a></li>
</lr:PreviousEnabled>
<lr:PreviousDisabled>
<li>Previous</li>
</lr:PreviousDisabled>
<li><a href="$gridPageLink">Index</a></li>
<lr:NextEnabled>
<li><a href="$link">Next</a></li>
</lr:NextEnabled>
<lr:NextDisabled>
<li>Next</li>
</lr:NextDisabled>
</lr:Pagination>
</ul>
</div>
<a href="$gridPageLink">
<img src="bin/images/large/<%= image.exportFilename %>.jpg" />
</a>
<pre> <%= --[[ Code added by John R. Ellis ]]
"Value of com.johnrellis.anyfile:file -- " .. (anyfileFile or "")
--[[ End of code added by John R. Ellis ]] %>
</pre>
<xmpl:aQuote>You know what they say:<br>
<xmpl:saying> <br />....how interesting!<br /></xmpl:saying>
</xmpl:aQuote>
<% --[[ Include the page footer]] %>
<%@ include file="footer.html" %>
Copy link to clipboard
Copied
Thank you. Very helpful. Sorry to ask for this, but how would you do it if you were to add custom metadata to the grid.html, perhaps adding the metadata below the thumbnail?
Craig
Copy link to clipboard
Copied
<%
--[[ Define some variables to make locating other resources easier.]]
local mySize = "thumb"
local others = "content"
local theRoot = "."
--[[ Code added by John R. Ellis ]]
local LrApplication = import 'LrApplication'
local catalog = LrApplication.activeCatalog ()
local idToPhoto = {}
for _, photo in ipairs (catalog:getAllPhotos ()) do
idToPhoto [photo.localIdentifier] = photo
end
--[[ End code added by John R. Ellis ]]
%>
<% --[[ Include the page header]] %>
<%@ include file="header.html" %>
<lr:ThumbnailGrid>
<lr:GridPhotoCell>
<a href="$others/<%= image.exportFilename %>_large.html">
<% --[[ Code added by John R. Ellis ]]
local photo = idToPhoto [image.imageID]
local anyfileFile = photo:getPropertyForPlugin ("com.johnrellis.anyfile", "file")
--[[ End code added by John R. Ellis ]]
%>
<img src="$others/bin/images/thumb/<%= image.exportFilename %>.jpg" id="<%= image.imageID %>" class="thumb" />
</a>
<%= --[[ Code added by John R. Ellis ]]
anyfileFile %>
</lr:GridPhotoCell>
</lr:ThumbnailGrid>
<% if numGridPages > 1 then %>
<div class="pagination">
<ul>
<lr:Pagination>
<lr:CurrentPage>
<li>$page</li>
</lr:CurrentPage>
<lr:OtherPages>
<li><a href="$link">$page</a></li>
</lr:OtherPages>
<lr:PreviousEnabled>
<li><a href="$link">Previous</a></li>
</lr:PreviousEnabled>
<lr:PreviousDisabled>
<li>Previous</li>
</lr:PreviousDisabled>
<lr:NextEnabled>
<li><a href="$link">Next</a></li>
</lr:NextEnabled>
<lr:NextDisabled>
<li>Next</li>
</lr:NextDisabled>
</lr:Pagination>
</ul>
</div>
<% end %>
<% --[[ Include the page footer]] %>
<%@ include file="footer.html" %>
Copy link to clipboard
Copied
Brilliant. John, thank you for the great example.
Craig
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more