metadata-extractor-001

Tests extracting metadata from a JPG image

Test metadata-extractor-001.xml is expected to pass.

The pipeline

<p:declare-step xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:p="http://www.w3.org/ns/xproc" version="3.0">
   <p:import href="https://xmlcalabash.com/ext/library/metadata-extractor.xpl"/>
   <p:output port="result"/>
   <cx:metadata-extractor>
      <p:with-input href="../../../../xmlcalabash/src/test/resources/cx-metadata-extractor/amaryllis.jpg"/>
   </cx:metadata-extractor>
</p:declare-step>

Schematron validation

<s:schema xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
   <s:ns prefix="c" uri="http://www.w3.org/ns/xproc-step"/>
   <s:pattern>
      <s:rule context="/">
         <s:assert test="c:result">The document root is not c:result.</s:assert>
         <s:assert test="c:result/c:tag[@type='0x0003'] = 'image/jpeg'">The image is not identified as image/jpeg.</s:assert>
         <s:assert test="c:result/c:tag[@name = 'Artist'] = 'Norman Walsh'">The image artist is not correct.</s:assert>
         <s:assert test="contains(c:result/c:tag[@name = 'Keywords'], 'flowers')">The image does not have the “flowers” keyword.</s:assert>
         <s:assert test="contains(c:result/c:tag[@name = 'Keywords'], 'red')">The image does not have the “red” keyword.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

26 Oct 2024, Norm Tovey-Walsh

Created test.