6 January 2014

Using ExpPrint to create a Photo Catalogue with your photo people tags/metadata

For a while I’ve been investigating how to future proof my scanned family photos so that they retain their people name metadata. Unfortunately, it appears that there’s not yet consensus from the different photo editor vendors on how such information should be stored. Geoff Coupe’s blog contains some of the most comprehensive practical information I’ve come across so far.

The issue boiled down to the fact that I couldn’t be sure that any future software would correctly retain or migrate the current people metadata. I’m fairly sure the opposite is more likely to be the norm. Therefore, as a precautionary measure I thought I’d look into capturing a thumbnail of the image along with its metadata. I investigated specialist media cataloguing applications, assuming that they would do the job seamlessly. I had Microsoft Expression Media 2 (which was iView Media and is now Phase One Media Pro), and I also had a look at Daminion, but neither seemed to be able to output the people information that Microsoft Live Photo Gallery can embed in the photo files with its face recognition facility. I like Microsoft Photo Gallery because it embeds the people information into the photo file rather than in its own separate database file which could easily get disconnected from the photo files.

It then struck me that ExpPrint can output the Photo Gallery people information, so all I needed to do to make ExpPrint into a functional Photo Cataloguing facility was to have it show thumbnails of the photos.

Because ExpPrint’s architecture is quite open and flexible, I fairly quickly modified the XSL transformation file so that the HTML output contained <img> tags to the photo files. The initial test was fine, I could show a thumbnail of the photo along with the photo metadata, so I fine-tuned the code to do some further tests on it.

Unfortunately, displaying thumbnail images from high resolution photos doesn’t seem to be a workable facility. All the current browsers I’ve tried (Internet Explorer 10 &11, FireFox 24, Chrome 31) have terrible performance and other issues displaying anything but a small number of high resolution photos. FireFox and Chrome gobbled loads of memory, bringing themselves and the OS to a grinding halt, while Internet Explorer 10/11 seem to give up and leave many images as empty rectangles with a white X on a black background.

On the off-chance that future browsers may behave better with large images, or you have a system with tons of RAM that will allow the browsers to work well, I’ll document the changes that can be done to the XSL transformation so that I don’t forget this.

For my own use, I’ve decided to just keep a listing of the photo file name and the metadata. It’s not as nice as having a thumbnail of the photo, but I think it’ll at least provide the information I wanted to retain.

Altering the Detailed Table “Create each listed item as a hyperlink” option to create thumbnails

In the CommonTableCellOutput.xsl file (located in %Program Files%\JD Design\ExpPrint\Plugins directory, locate this code section:

        <xsl:when test="$gCreateAsLinks">
<!--Hyperlinked-->
<a>
<xsl:attribute name="href">file:///<xsl:value-of select="../@System.ItemPathDisplay"/>
</xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute>
<xsl:choose>
<xsl:when test="$FullName = '1'">
<xsl:value-of select="../@System.ItemPathDisplay"/>
</xsl:when>
<xsl:otherwise>
<!-- Set the DName to display the title attribute for Fitems-->
<xsl:choose>
<!--If the Title attribute exists, use it, otherwise use the default (Dname)-->
<xsl:when test="../@System.Title and ($gUseTitleAsName = '1')">
<xsl:value-of select="../@System.Title"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:when>



Replace it with this:


   1:         <xsl:when test="$gCreateAsLinks">
   2:            <xsl:choose>
   3:              <!--If it's a picture-->
   4:              <xsl:when test="../@System.Kind='Picture'">
   5:                <img src="file:///{../@System.ItemPathDisplay}" height="55"/>
   6:              </xsl:when>
   7:              <xsl:otherwise>
   8:                <xsl:value-of select="."/>
   9:              </xsl:otherwise>
  10:            </xsl:choose>
  11:          </xsl:when>



Line 1 is the test on the “Create … as hyperlink” option.


Line 4 tests that the item is a picture and if so, line 5 outputs the <img> tag for the file, shrinking the height to a fixed size (55 pixels in this example) to show the image as a thumbnail rather than at its real dimensions.


If you do try this, ensure you don’t have Windows Explorer set to hide file extensions for known file types, otherwise it won’t work as the System.ItemPathDisplay property omits the file extension if Explorer is set to hide the extension.


Here’s an example screen shot of the ExpPrint listing showing the thumbnail,  and the People and Date Taken metadata properties:


image

No comments:

Post a Comment