Generate Photo Gallery XML for Spry with Adobe Bridge
I've discovered/worked out a way to generate a very useful photos.xml from Adobe Bridge. If you use Bridge, it's very easy to add titles, keywords, ratings -- all kinds of metadata that one might use in a photo gallery.
The script is based on one I found at the Adobe User to User Bridge Scripting Forum for exporting a CSV file. Link to forum thread (this also shows most of the other metadata you can grab and how to get it into JS).
Note 1: this particular script doesn't take into account CDATA that might exist in your metadata, like ampersands in your title. Thus far, I've just avoided using those, but one could also have the script write out a CDATA node for that info instead.
Note 2: this script does not write out a thumbpath, thumbwidth or thumbheight attribute. But usually the thumbpath is the exact same as the regular "path" attribute, and the thumbwidth and thumbheight are just a ratio of the regular "width" and "height" attributes. I added a bit of JS to the gallery.js file to calculate those before growing the thumbnail on rollover.
Right now I'm using keywords as categories and titles as captions and sorting by rating (stars in Bridge), so here's the .jsx file I created. The script should be saved to the folder "StartupScripts" in Program Files/Common Files/Adobe. It's then run by launching Bridge, browsing to the folder that holds your photo gallery large image files, and choosing Tools>Export XML File from the top menu.
Download a zip with the .jsx file.
I made some changes to the script so it now generates thumbnail info, and other clean-ups. See the related post, here.
The script is based on one I found at the Adobe User to User Bridge Scripting Forum for exporting a CSV file. Link to forum thread (this also shows most of the other metadata you can grab and how to get it into JS).
Note 1: this particular script doesn't take into account CDATA that might exist in your metadata, like ampersands in your title. Thus far, I've just avoided using those, but one could also have the script write out a CDATA node for that info instead.
Note 2: this script does not write out a thumbpath, thumbwidth or thumbheight attribute. But usually the thumbpath is the exact same as the regular "path" attribute, and the thumbwidth and thumbheight are just a ratio of the regular "width" and "height" attributes. I added a bit of JS to the gallery.js file to calculate those before growing the thumbnail on rollover.
if (lgWidth > lgHeight)
{ width = gThumbLargestSide;
height = (gThumbLargestSide * lgHeight)/lgWidth;}
else
{ height = gThumbLargestSide;
width = (gThumbLargestSide * lgWidth)/lgHeight;};
Right now I'm using keywords as categories and titles as captions and sorting by rating (stars in Bridge), so here's the .jsx file I created. The script should be saved to the folder "StartupScripts" in Program Files/Common Files/Adobe. It's then run by launching Bridge, browsing to the folder that holds your photo gallery large image files, and choosing Tools>Export XML File from the top menu.
Download a zip with the .jsx file.
I made some changes to the script so it now generates thumbnail info, and other clean-ups. See the related post, here.
0 Comments:
Post a Comment
<< Home