All Downloads are FREE. Search and download functionalities are using the official Maven repository.

implementationcheckers.TIFF_EP.xml Maven / Gradle / Ivy

There is a newer version: 1.2.8
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<implementationCheckerObject xmlns="http://www.dpfmanager.org/ProfileChecker"
                             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                             xsi:schemaLocation="http://www.dpfmanager.org/ProfileChecker ProfileChecker.xsd">

    <title>TIFF/EP</title>
    <iso>TIFF/EP image data format ISO 12234:2001(E)</iso>
    <description>The term TIFF/EP refers to Tag Image File Format/Electronic Photography, defined in this part of ISO 12234.
        The term "TIFF 6.0" refers to the TIFF Revision 6.0 specification.
        TIFF/EP is defined to be as compatible as possible with existing desktop software packages, to enable them to operate with images from electronic still-picture cameras.
        TIFF Revision 6.0 is used as the basis for achieving this interoperability with the large installed base of imaging software.
        Wherever possible, TIFF/EP uses tags already defined in TIFF 6.0 and provides guidelines for the use of these tags as well as the allowed field values.
        New tags are defined to encode image data features that are not included in TIFF 6.0. These new tags conform to the practices specified in TIFF 6.0.
        This document also describes how related images, such as both "parent" high resolution and "thumbnail" low resolution images of the same subject, or temporal sequence "bursts" of the same scene, can be stored in a single TIFF/EP file.</description>
    <version>1.0.0</version>
    <author>Easy Innova</author>
    <date>2016-09-20</date>
    
 <include><policyChecker>TIFF_Baseline_Extended_6_0.xml</policyChecker>
     <excluderules>TAG-254-0003</excluderules>
     <excluderules>TAG-254-0004</excluderules>
     <excluderules>TAG-254-0005</excluderules>
     <excluderules>TAG-254-0009</excluderules>
     <excluderules>TAG-262-0003</excluderules>
     <excluderules>TAG-259-1-0001</excluderules>
     <excluderules>TAG-530-0004</excluderules>
     <excluderules>TAG-531-0005</excluderules>
     <excluderules>TAG-529-0005</excluderules>
     <excluderules>TAG-529-0004</excluderules>
    
 </include>
 <include>
     <policyChecker>TIFF_Baseline_Core_6_0.xml</policyChecker>
     <excluderules>TAG-306-0003</excluderules>
 </include>   

    <rules id="TAG-37398">
        <title>TIFF/EPStandardID</title>
        <description>For the current version of TIFF/EP, TIFF/EPStandardID tag value shall equal the following four bytes: 1 0 0 0. Usage: IFD0
            
            Tag = 37398 (9216.H)
            Type = BYTE
            N = 4
            Value = 1000
        </description>
        
        <rule id="TAG-37398-0001" context="tag[id=37398]" level="error">
            <title>TIFF/EPStandardID valid Type</title>
            <description>TIFF/EPStandardID Tag type must be BYTE</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>16</page></reference>
            <assert test="{type=='BYTE'}">TIFF/EPStandardID type is not valid, an BYTE type is expected</assert>
        </rule>
        
        <rule id="TAG-37398-0002" context="tag[id=37398]" level="error">
            <title>TIFF/EPStandardID valid cardinality</title>
            <description>The cardinality of the TIFF/EPStandardID tag must be 4</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>16</page></reference>
            <assert test="{cardinality==4}">TIFF/EPStandardID must have a 4 cardinality</assert>
        </rule>
        
        <rule id="TAG-37398-0004" context="ifd[IFD0=1]" level="error" experimental="true">
            <title>TIFF/EPStandardID valid value</title>
            <description>TIFF/EPStandardID must contain a valid value</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>16</page></reference>
            <assert test="{tags.tag[name=TIFFEPStandardID] == 1,0,0,0}">TIFF/EPStandardID tag must contain a valid value 1000 defining the current TIFF/EP version</assert>
        </rule>
        
        <rule id="TAG-37398-0003" context="ifd[IFD0=1]" level="error">
            <title>TIFF/EPStandardID must be use in the first IFD</title>
            <description>TIFF/EPStandardID tag must be used in the first IFD</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>16</page></reference>
            <assert test="{tags.tag[name=TIFFEPStandardID]}">TIFF/EPStandardID tag must be used in the first IFD</assert>
        </rule>
        
        <rule id="TAG-37398-0005" context="ifd[class=image]" level="error" >
            <title>TIFF/EPStandardID should only be used in first IFD</title>
            <description>TIFF/EPStandardID should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>16</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=TIFFEPStandardID]}">TIFF/EPStandardID should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-245">
        <title>NewSubFileType</title>
        <description>This tag indicates whether the given IFD is a thumbnail or main (full-size) image. This tag is mandatory and there is no default value. The value shall be explicitly stated. If the current image is the main image, rather than the "thumbnail" image, a value of 0 shall be encoded in this field.
        
        Tag = 254 (FE.H)
        Type = LONG
        N = 1
        
        valid values:
        0: Full resolution image
        1: Thumbnail
        </description>
        
        <rule id="TAG-245-1-0001" context="ifd[class=image]" level="error">
            <title>NewSubFileType valid values</title>
            <description>NewSubFileType valid values are:
                0: Full resolution image
                1: Thumbnail
            </description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>17</page></reference>
            <assert test="{tags.tag[name=NewSubfileType] &gt; -1} &amp;&amp; {tags.tag[name=NewSubfileType] &lt; 2}">NewSubFileType invalid value.</assert>
        </rule>
        
        <rule id="TAG-245-1-0002" context="ifd[class=image]" level="error">
            <title>NewSubFileType is mandatory</title>
            <description>NewSubFileType is mandatory and there is no default value. The value shall be explicitly stated.</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>17</page></reference>
            <assert test="{tags.tag[name=NewSubfileType]}">NewSubFileType is mandatory the value shall be explicitly stated</assert>
        </rule>
    </rules>
    
    <rules id="TAG-330">
        <title>SubIFDs</title>
        <description>This tag encodes the offsets from the beginning of the file to the location of IFDs that are treeing from the current IFD. 
            This tag-value is used to point from the thumbnail IFD to the IFD containing the full resolution image.</description>
        
        <rule id="TAG-330-0001" context="tag[id=330]" level="error">
            <title>SubIFDs valid Type</title>
            <description>SubIFDs Tag type must be LONG</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>17</page></reference>
            <assert test="{type=='LONG'}">SubIFDs type is not valid, an LONG type is expected</assert>
        </rule>
        
        <rule id="TAG-330-0002" context="tag[id=330]" level="warning">
            <title>SubIFDs cardinality</title>
            <description>The cardinality of theSubIFDs may be grater than 1 but currently (actual TIFF/EP specifications), defines the cardinality of 1 and the Value contains the offset to the IFD containing the full resolution image.</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>17</page></reference>
            <assert test="{cardinality &gt; 1}">SubIFDs should have a 1 cardinality defines by the current TIFF/EP specification</assert>
        </rule>
    </rules>
    
    <rules id="TAG-296">
        <title>ResolutionUnit</title>
        <description>This tag encodes the unit of measurement for the XResolution and YResolution. This tag is mandatory and there is no default value.
            
            Tag Name = ResolutionUnit
            Tag = 296 (128.H)
            Type = SHORT</description>
        
        <rule id="TAG-296-1-0001" context="ifd[class=image]" level="error">
            <title>ResolutionUnit is mandatory</title>
            <description>ResolutionUnit is mandatory and there is no default value. The value shall be explicitly stated.</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>18</page></reference>
            <assert test="{tags.tag[name=ResolutionUnit]}">ResolutionUnit is mandatory the value shall be explicitly stated</assert>
        </rule>
    </rules>
    
    <rules id="TAG-37390">
        <title>FocalPlaneXResolution</title>
        <description>This optional tag encodes the number of pixels per FocalPlaneResolutionUnit in the ImageWidth direction for the main image. This tag specifies the actual FocalPlaneXResolution at the focal plane of the camera.
            
            Tag Name = FocalPlaneXResolution
            Tag = 37390 (920E.H)
            Type = RATIONAL
            N = 1</description>
        
        <rule id="TAG-37390-0001" context="tag[id=37390]" level="error">
            <title>FocalPlaneXResolution valid Type</title>
            <description>FocalPlaneXResolution Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>18</page></reference>
            <assert test="{type=='RATIONAL'}">FocalPlaneXResolution type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-37390-0002" context="tag[id=37390]" level="error">
            <title>FocalPlaneXResolution valid cardinality</title>
            <description>The cardinality of the FocalPlaneXResolution tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>18</page></reference>
            <assert test="{cardinality==1}">FocalPlaneXResolution must have a 1 cardinality</assert>
        </rule>
        
        <rule id="TAG-37390-0004" context="ifd[class=image]" level="error" >
            <title>FocalPlaneXResolution should only be used in first IFD</title>
            <description>FocalPlaneXResolution should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>18</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=FocalPlaneXResolution]}">FocalPlaneXResolution should only be used in the first IFD</assert>
        </rule>
        
        <rule id="TAG-37390-0005" context="ifd[class=image]" level="error" >
            <title>FocalPlaneXResolution with FocalPlaneYResolution and FocalPlaneResolutionUnit</title>
            <description>FocalPlaneXResolution should only be used with FocalPlaneYResolution and FocalPlaneResolutionUnit</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>19</page></reference>
            <assert test="{!tags.tag[name=FocalPlaneXResolution]} || {tags.tag[name=FocalPlaneYResolution]} &amp;&amp; {tags.tag[name=FocalPlaneResolutionUnit]}">FocalPlaneXResolution should only be used with FocalPlaneYResolution and FocalPlaneResolutionUnit</assert>
        </rule>

        <rule id="TAG-37390-0006" context="ifds.ifd[class=image]" level="error">
            <title>Check valid values for tag FocalPlaneResolutionUnit</title><description>Check valid values for tag FocalPlaneResolutionUnit</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>19</page></reference>
            <assert test="{tags.tag[name=FocalPlaneResolutionUnit] > 0} &amp;&amp; {tags.tag[name=FocalPlaneResolutionUnitUnit] &lt; 6}">FocalPlaneResolutionUnit value must be between 1 and 5</assert>
        </rule>

    </rules>
    
    <rules id="TAG-37391">
        <title>FocalPlaneYResolution</title>
        <description>This optional tag encodes the number of pixels per FocalPlaneResolutionUnit in the ImageLength direction for the main image. This tag specifies the actual FocalPlaneYResolution at the focal plane of the camera.
            
            Tag Name = FocalPlaneYResolution
            Tag = 37391 (920E.H)
            Type = RATIONAL
            N = 1</description>
        
        <rule id="TAG-37391-0001" context="tag[id=37391]" level="error">
            <title>FocalPlaneYResolution valid Type</title>
            <description>FocalPlaneYResolution Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>19</page></reference>
            <assert test="{type=='RATIONAL'}">FocalPlaneYResolution type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-37391-0002" context="tag[id=37391]" level="error">
            <title>FocalPlaneYResolution valid cardinality</title>
            <description>The cardinality of the FocalPlaneYResolution tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>19</page></reference>
            <assert test="{cardinality==1}">FocalPlaneYResolution must have a 1 cardinality</assert>
        </rule>
        
        <rule id="TAG-37391-0003" context="ifd[class=image]" level="error" >
            <title>FocalPlaneYResolution only in first IFD</title>
            <description>FocalPlaneYResolution should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>19</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=FocalPlaneYResolution]}">FocalPlaneYResolution should only be used in the first IFD</assert>
        </rule>
        
        <rule id="TAG-37391-0004" context="ifd[class=image]" level="error" >
            <title>FocalPlaneYResolution with FocalPlaneXResolution and FocalPlaneYResolution</title>
            <description>FocalPlaneYResolution should only be used with FocalPlaneXResolution and FocalPlaneResolutionUnit</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>19</page></reference>
            <assert test="{!tags.tag[name=FocalPlaneYResolution]} || {tags.tag[name=FocalPlaneXResolution]} &amp;&amp; {tags.tag[name=FocalPlaneResolutionUnit]}">FocalPlaneYResolution should only be used with FocalPlaneXResolution and FocalPlaneResolutionUnit</assert>
        </rule>
    </rules>
    
    <rules id="TAG-37392">
        <title>FocalPlaneResolutionUnit</title>
        <description>This tag encodes the unit of measurement for the FocalPlaneXResolution and FocalPlaneYResolution.
            Tag = 37392 (9210.H)
            Type = SHORT
            N = 1
            Value = VALUE (possible values listed below)
            
            valid values are:
            1 Inch
            2 Metre
            3 Centimetre
            4 Millimetre
            5 Micrometre </description>
        
        <rule id="TAG-37392-0001" context="tag[id=37392]" level="error">
            <title>FocalPlaneResolutionUnit valid Type</title>
            <description>FocalPlaneResolutionUnit Tag type must be SHORT</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>19</page></reference>
            <assert test="{type=='SHORT'}">FocalPlaneResolutionUnit type is not valid, an SHORT type is expected</assert>
        </rule>
        
        <rule id="TAG-37392-0002" context="tag[id=37392]" level="error">
            <title>FocalPlaneResolutionUnit valid cardinality</title>
            <description>The cardinality of the FocalPlaneResolutionUnit tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>19</page></reference>
            <assert test="{cardinality==1}">FocalPlaneResolutionUnit must have a 1 cardinality</assert>
        </rule>
        
        <rule id="TAG-37392-0003" context="ifd[IFD0=1]" level="error">
            <title>FocalPlaneResolutionUnit valid values</title>
            <description>FocalPlaneResolutionUnit valid values are:
                1 Inch
                2 Metre
                3 Centimetre
                4 Millimetre
                5 Micrometre</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>19</page></reference>
            <assert test="{tags.tag[name=FocalPlaneResolutionUnit] &gt; 0} &amp;&amp; {tags.tag[name=FocalPlaneResolutionUnit] &lt; 6}">FocalPlaneResolutionUnit invalid value.</assert>
        </rule>
        
        <rule id="TAG-37392-0004" context="ifd[class=image]" level="error" >
            <title>FocalPlaneResolutionUnit only in first IFD</title>
            <description>FocalPlaneResolutionUnit should only be used in the first IFD</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>19</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=FocalPlaneResolutionUnit]}">FocalPlaneResolutionUnit should only be used in the first IFD</assert>
        </rule>
        
        <rule id="TAG-37392-0005" context="ifd[class=image]" level="error" >
            <title>FocalPlaneResolutionUnit with FocalPlaneXResolution and FocalPlaneYResolution</title>
            <description>FocalPlaneResolutionUnit should only be used with FocalPlaneXResolution and FocalPlaneYResolution</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>19</page></reference>
            <assert test="{!tags.tag[name=FocalPlaneResolutionUnit]} || {tags.tag[name=FocalPlaneXResolution]} &amp;&amp; {tags.tag[name=FocalPlaneYResolution]}">FocalPlaneResolutionUnit should only be used with FocalPlaneXResolution and FocalPlaneYResolution</assert>
        </rule>
    </rules>
    
    <rules id="TAG-274">
        <title>Orientation</title>
        <description>This optional tag encodes the orientation of the camera relative to the scene, when the image was captured.
            
            Tag = 274 (112.H)
            Type = SHORT
            N = 1
            
            valid values are:
            
            1: The 0th row represents the visual top of the image and the 0th column represents the visual left-hand side. The camera orientation is known to be in the normal "landscape" orientation.
            3: The 0th row represents the visual bottom of the image and the 0th column represents the visual righthand side. Normal orientation rotated 180 degrees.
            6: The 0th row represents the visual right-hand side of the image and the 0th column represents the visual top. Normal orientation rotated clockwise 90 degrees.
            8: The 0th row represents the visual left-hand side of the image and the 0th column represents the visual bottom. Normal orientation rotated counter-clockwise 90 degrees.
            9: Orientation is unknown.</description>
        <rule id="TAG-274-1-0001" context="ifd[class=image]" level="error">
            <title>Orientation valid values</title>
            <description>Orientation valid values are: 
                1: landscape
                2: Normal orientation rotated 180 degrees.
                3: Normal orientation rotated clockwise 90 degrees.
                4: Normal orientation rotated counter-clockwise 90 degrees.</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>20</page></reference>
            <assert test="{tags.tag[name=Orientation] == 1} || {tags.tag[name=Orientation] == 3} || {tags.tag[name=Orientation] == 6} || {tags.tag[name=Orientation] == 8} || {tags.tag[name=Orientation] == 9}">Orientation valid values regarding the TIFF/EP specifications are 1,3,6,8 or 9</assert>
        </rule>
        
        <rule id="TAG-274-1-0004" context="ifd[class=image]" level="error" >
            <title>Orientation only in first IFD</title>
            <description>Orientation should only be used in the first IFD</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>20</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=Orientation]}">Orientation should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-262">
        <title>PhotometricInterpretation</title>
        <description>In TIFF/EP, this tag defines the colour space of the image data components and the order of the components. 
            This tag is mandatory and there is no default value.
        
        Tag = 262 (106.H)
        Type = SHORT
        N = 1
        
        1 BlackIsZero. Used to describe greyscale images. 0 is black, 2**BitsPerSample - 1 is white
        2 RGB. Used for images stored in RGB colour space. Red, green and blue minimum intensity is 0, and maximum intensity is 2**BitsPerSample - 1. The component order shall be R, G, B.
        6 YCbCr colour space. Y refers to the luminance component, Cb and Cr refer to the two chrominance components. The component order shall be Y, Cb, Cr.
        32803  CFA. TIFF/EP readers are not required to handle this tag value. Used to describe "raw" image data from single-chip colour sensors having a colour filter array (CFA) overlay. 
        >32767 These values are "Vendor Unique" and are not required to be interpreted by others. These values need to be obtained from Adobe Corporation.
        </description>
        
        <rule id="TAG-262-1-0001" context="ifd[class=image]" level="error">
            <title>valid PhotometricInterpretation vales</title>
            <description>The PhotometricInterpretation value shall be 1(grayscale), 2(RGB), 6(YCbCr), 32803(CFA) or other values above 32767.</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>21</page></reference>
            <assert test="{tags.tag[name=PhotometricInterpretation]==1} || {tags.tag[name=PhotometricInterpretation]==2} || {tags.tag[name=PhotometricInterpretation]==6} || {tags.tag[name=PhotometricInterpretation]==32803} || {tags.tag[name=PhotometricInterpretation] &gt; 32767}">invalid PhotometricInterpretation for a full resolution image</assert>
        </rule>
        
        <rule id="TAG-262-1-0002" context="ifd[thumbnail=0]" level="error">
            <title>valid PhotometricInterpretation for full resolution image</title>
            <description>The PhotometricInterpretation value shall be 1(grayscale), 2(RGB) ,6(YCbCr) , 32803(CFA) or other values above 32767 for the full resolution image.</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>21</page></reference>
            <assert test="{tags.tag[name=PhotometricInterpretation]==1} || {tags.tag[name=PhotometricInterpretation]==2} || {tags.tag[name=PhotometricInterpretation]==6} || {tags.tag[name=PhotometricInterpretation]==32803} || {tags.tag[name=PhotometricInterpretation] &gt; 32767}">invalid PhotometricInterpretation for a full resolution image</assert>
        </rule>
        
        <rule id="TAG-262-1-0003" context="ifd[thumbnail=1]" level="error">
            <title>valid PhotometricInterpretation for thumbnail image</title>
            <description>The PhotometricInterpretation value shall be 1, 2 or 6 for the Thumbnail IFD.</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>21</page></reference>
            <assert test="{tags.tag[name=PhotometricInterpretation]==1} || {tags.tag[name=PhotometricInterpretation]==2} || {tags.tag[name=PhotometricInterpretation]==6}">Invalid PhotometricInterpretation for a thumbnail image</assert>
        </rule>
    </rules>
    
    <rules id="TAG-34857">
        <title>Interlace</title>
        <description>This optional tag indicates the field number of multifield images. The tag allows for both simple vertical interlace of between 2 and 255 interlace fields per frame and for two-dimensional interlace of up to 127 vertical x 127 horizontal spatial offset locations per frame. 
            Another application of this interlace mechanism is to store images for progressive transmission. For 2:1 vertical interlace, as employed in many video systems, the first field (lines 1, 3, 5 from the frame image) is indicated with a tag value = 1, and the second field is indicated with a tag value = 2. 
            For 2-dimensional interlace, the 7 least significant bits of the value indicate the vertical field number, and the next 7 bits indicate the horizontal field number. To store multiple interlace fields in one TIFF/EP file, the different fields shall use the IFD chaining mechanism.
            
            Tag = 34857 (8829.H)
            Type = SHORT
            N = 1
      
        valid values are:
        0 non-interlaced (progressive scan)
        1 vertical field 1, horizontal field 1 (video field 1, "odd" lines)
        2 vertical field 2, horizontal field 1 (video field 2, "even" lines)
        3-127 vertical field 3-127, horizontal field 1
        128 vertical field 1, horizontal field 2.
        129-255 vertical field 2-127, horizontal field 2
        256-16383 vertical field 1-127, horizontal field 3-127</description>
        
        
        <rule id="TAG-34857-0001" context="tag[id=34857]" level="error">
            <title>Interlace valid Type</title>
            <description>Interlace Tag type must be SHORT</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>22</page></reference>
            <assert test="{type=='SHORT'}">Interlace type is not valid, an SHORT type is expected</assert>
        </rule>
        
        <rule id="TAG-34857-0002" context="tag[id=34857]" level="error">
            <title>Interlace valid cardinality</title>
            <description>The cardinality of the Interlace tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>22</page></reference>
            <assert test="{cardinality==1}">Interlace must have a 1 cardinality</assert>
        </rule>
        
        <rule id="TAG-34857-0003" context="ifd[IFD0=1]" level="error">
            <title>Interlace valid values</title>
            <description>Interlace valid values are between 0 and 16383.
                0 non-interlaced (progressive scan)
                1 vertical field 1, horizontal field 1 (video field 1, "odd" lines)
                2 vertical field 2, horizontal field 1 (video field 2, "even" lines)
                3-127 vertical field 3-127, horizontal field 1
                128 vertical field 1, horizontal field 2.
                129-255 vertical field 2-127, horizontal field 2
                256-16383 vertical field 1-127, horizontal field 3-127</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>22</page></reference>
            <assert test="{tags.tag[name=Interlace] &gt; -1} &amp;&amp; {tags.tag[name=Interlace] &lt; 16384}">Interlace invalid value.</assert>
        </rule>
        
        <rule id="TAG-34857-0004" context="ifd[class=image]" level="error" >
            <title>Interlace only in first IFD</title>
            <description>Interlace should only be used in the first IFD</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>22</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=Interlace]}">Interlace should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-37399">
        <title>SensingMethod</title>
        <description>This mandatory tag encodes the type of image sensor used in the camera or image-capturing device.
            
            Tag = 37399 (9217.H)
            Type = SHORT
            N = 1
            
            valid values are:
            0 Undefined
            1 MonochromeArea sensor
            2 OneChipColourArea sensor
            3 TwoChipColourArea sensor
            4 ThreeChipColourArea sensor
            5 ColourSequentialArea sensor
            6 MonochromeLinear sensor
            7 TriLinear sensor
            8 ColourSequentialLinear sensor</description>
        
        
        <rule id="TAG-37399-0001" context="tag[id=37399]" level="error">
            <title>SensingMethod valid Type</title>
            <description>SensingMethod Tag type must be SHORT</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>22</page></reference>
            <assert test="{type=='SHORT'}">SensingMethod type is not valid, an SHORT type is expected</assert>
        </rule>
        
        <rule id="TAG-37399-0002" context="tag[id=37399]" level="error">
            <title>SensingMethod valid cardinality</title>
            <description>The cardinality of the SensingMethod tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>22</page></reference>
            <assert test="{cardinality==1}">SensingMethod must have a 1 cardinality</assert>
        </rule>
        
        <rule id="TAG-37399-0003" context="ifd[IFD0=1]" level="error">
            <title>SensingMethod valid values</title>
            <description>SensingMethod valid values are between 0 and 16383.
                0 Undefined
                1 MonochromeArea sensor
                2 OneChipColourArea sensor
                3 TwoChipColourArea sensor
                4 ThreeChipColourArea sensor
                5 ColourSequentialArea sensor
                6 MonochromeLinear sensor
                7 TriLinear sensor
                8 ColourSequentialLinear sensor</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>22</page></reference>
            <assert test="{tags.tag[name=SensingMethod] &gt; -1} &amp;&amp; {tags.tag[name=SensingMethod] &lt; 9}">SensingMethod invalid value.</assert>
        </rule>
        
        <rule id="TAG-37399-0004" context="ifd[class=image]" level="error" >
            <title>SensingMethod  in first IFD</title>
            <description>SensingMethod must be used in the first IFD</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>22</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=SensingMethod]}">SensingMethod should only be used in the first IFD</assert>
        </rule>
        
        <rule id="TAG-37399-0005" context="ifd[class=image]" level="error" >
            <title>SensingMethod only in first IFD</title>
            <description>SensingMethod should only be used in the first IFD</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>22</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=Interlace]}">SensingMethod should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-33421">
        <title>CFARepeatPatternDim</title>
        <description>This tag encodes the number of pixels horizontally and vertically that are needed to uniquely define the repeat pattern of the colour filter array (CFA) pattern used in the colour image sensor. 
            It is mandatory when PhotometricInterpretation = 32803, and there are no defaults allowed. It is optional when PhotometricInterpretation = 2 or 6 and SensingMethod = 2, where it can be used to indicate the original sensor sampling positions.
        
        Tag = 33421(828D.H)
        Type = SHORT
        N = 2
        
        value 0 = CFARepeatRows. The minimum number of rows needed to uniquely define the CFA pattern.
        value 1 = CFARepeatCols. The minimum number of columns needed to uniquely define the CFA pattern.
        </description>
        
        <rule id="TAG-33421-0001" context="tag[id=33421]" level="error">  
            <title>CFARepeatPatternDim valid Type</title>
            <description>CFARepeatPatternDim Tag type must be SHORT</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>23</page></reference>
            <assert test="{type=='SHORT'}">CFARepeatPatternDim type is not valid, an SHORT type is expected</assert>
        </rule>
        
        <rule id="TAG-33421-0002" context="tag[id=33421]" level="error">
            <title>CFARepeatPatternDim valid cardinality</title>
            <description>The cardinality of the CFARepeatPatternDim tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>23</page></reference>
            <assert test="{cardinality==2}">CFARepeatPatternDim must have a 1 cardinality</assert>
        </rule>
        
        <rule id="TAG-33421-0003" context="ifd[class=image]" level="error">
            <title>CFARepeatPatternDim valid values</title>
            <description>CFARepeatPatternDim valid values are between 0 and 16383.
                0 Undefined
                1 MonochromeArea sensor
                2 OneChipColourArea sensor
                3 TwoChipColourArea sensor
                4 ThreeChipColourArea sensor
                5 ColourSequentialArea sensor
                6 MonochromeLinear sensor
                7 TriLinear sensor
                8 ColourSequentialLinear sensor</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>23</page></reference>
            <assert test="{tags.tag[name=CFARepeatPatternDim] &gt; -1} &amp;&amp; {tags.tag[name=CFARepeatPatternDim] &lt; 2}">CFARepeatPatternDim invalid value.</assert>
        </rule>
        
        <rule id="THUMBNAIL-0011" context="ifd[thumbnail=0]" level="error">
            <title>CFARepeatPatternDim in CFA full resolution image</title>
            <description>CFARepeatPatternDim is mandatory for full resolution image when PhotometricInterpretation = 32803</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>23</page></reference>
            <assert test="{tags.tag[name=PhotometricInterpretation] != 32803} || {tags.tag[name=CFARepeatPatternDim]}">FARepeatPatternDim is mandatory for CFA full resolution image</assert>
        </rule>
    </rules>
    
    <rules id="TAG-33422">
        <title>CFAPattern</title>
        <description>This tag encodes the actual colour filter array geometric pattern of the image sensor used to capture the singlesensor colour image. It is mandatory when PhotometricInterpretation = 32803, and there are no defaults allowed.
            It is optional when PhotometricInterpretation = 2 or 6 and SensingMethod = 2, where it can be used to indicate the original sensor sampling positions.
            
            Tag = 33422(828E.H)
            Type = BYTE
            N = CFARepeatRows * CFARepeatCols
        </description>
        
        <rule id="TAG-33422-0001" context="tag[id=33422]" level="error">  
            <title>CFAPattern valid Type</title>
            <description>CFAPattern Tag type must be BYTE</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>23</page></reference>
            <assert test="{type=='BYTE'}">CFAPattern type is not valid, an BYTE type is expected</assert>
        </rule>
        
        <rule id="TAG-33422-0002" context="ifd[thumbnail=0]" level="error" experimental="true">
            <title>CFAPattern valid cardinality</title>
            <description>The cardinality of the CFAPattern tag must be CFARepeatRows * CFARepeatCols</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>23</page></reference>
            <assert test="{tags.tag[name=CFAPattern].cardinality == tags.tag[name=CFARepeatPatternDim](0)*tags.tag[name=CFARepeatPatternDim](1)}">CFAPattern must have a CFARepeatRows * CFARepeatCols cardinality</assert>
        </rule>
        
        <rule id="TAG-33422-0003" context="ifd[thumbnail=0]" level="error">
            <title>CFAPattern in CFA full resolution image</title>
            <description>CFAPattern is mandatory for full resolution image when PhotometricInterpretation = 32803</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>23</page></reference>
            <assert test="{tags.tag[name=PhotometricInterpretation] != 32803} || {tags.tag[name=CFARepeatPatternDim]}">CFAPattern is mandatory for CFA full resolution image</assert>
        </rule>
    </rules>
    
    <rules id="TAG-277">
        <title>SamplesPerPixel</title>
        <description>This tag encodes the number of components or samples stored for each pixel in the image. This tag is mandatory
            and there is no default value. The value shall be explicitly stated.
        
        Tag = 277 (115.H)
        Type = SHORT
        N = 1
        </description>
        
        <rule id="TAG-277-1-0001" context="ifd[class=image]" level="error">
            <title>SamplesPerPixel for CFA images</title>
            <description>SamplesPerPixel must be 1 for CFA images</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>24</page></reference>
            <assert test="{tags.tag[name=PhotometricInterpretation] != 32803} || {tags.tag[name=SamplesPerPixel] == 1}">Invalid SamplesPerPixel for CFA image</assert>
        </rule>
        
        <rule id="TAG-277-1-0002" context="ifd[class=image]" level="error">
            <title>SamplesPerPixel for Grayscale images</title>
            <description>SamplesPerPixel must be 1 for Grayscale images</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>24</page></reference>
            <assert test="{tags.tag[name=PhotometricInterpretation] != 1} || {tags.tag[name=SamplesPerPixel] == 1}">Invalid SamplesPerPixel for CFA image</assert>
        </rule>
        
        <rule id="TAG-277-1-0003" context="ifd[class=image]" level="error">
            <title>SamplesPerPixel for RGB images</title>
            <description>SamplesPerPixel must be 3 for RGB images</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>24</page></reference>
            <assert test="{tags.tag[name=PhotometricInterpretation] != 2} || {tags.tag[name=SamplesPerPixel] == 3}">Invalid SamplesPerPixel for RGB image</assert>
        </rule>
        
        <rule id="TAG-277-1-0004" context="ifd[class=image]" level="error">
            <title>SamplesPerPixel for YCbCr images</title>
            <description>SamplesPerPixel must be 3 for YCbCr images</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>24</page></reference>
            <assert test="{tags.tag[name=PhotometricInterpretation] != 6} || {tags.tag[name=SamplesPerPixel] == 3}">Invalid SamplesPerPixel for YCbCr image</assert>
        </rule>
    </rules>
    
    <rules id="TAG-259">
        <title>Compression</title>
        <description>This tag encodes the compression scheme used to store the image data. This tag is mandatory and there is no
            default value. The tag value shall equal "1" for the thumbnail IFD.</description>
        <rule id="TAG-259-1-0001" context="ifd[class=image]" level="error">
            <title>Compression valid values</title>
            <description>Compression valid values are:
                1 No compression. Data is packed as tightly as possible into bytes, padding at the end of the row to assure that each row's data ends upon a byte boundary.
                7 TIFF/JPEG compression. JPEG bitstream defines whether Baseline DCT JPEG or other JPEG version is used. TIFF/EP readers are only required to support Baseline DCT JPEG method.
                Other Values above 32767 .These values are "Vendor Unique" and are not required to be interpreted by others. These "private" values need to be obtained from Adobe Corporation.
            </description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>27</page></reference>
            <assert test="{tags.tag[name=Compression] == 1} || {tags.tag[name=Compression] == 7} || {tags.tag[name=Compression] &gt; 32767}">invalid compression value</assert>
        </rule>
        <rule id="TAG-259-1-0002" context="ifd[class=image]" level="error">
            <title>Compression is mandatory</title>
            <description>This tag is mandatory and there is no default value. The tag value shall equal "1" for the thumbnail IFD.</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>27</page></reference>
            <assert test="{tags.tag[name=Compression]}">Compression tag is mandatory</assert>
        </rule>
        <rule id="TAG-259-1-0003" context="ifd[thumbnail=1]" level="error">
            <title>Thumbnail must be uncompressed</title>
            <description>The Compression tag value shall equal "1" for the thumbnail IFD</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>27</page></reference>
            <assert test="{tags.tag[name=Compression] == 1}">Thumbnail must be uncompressed</assert>
        </rule>
        <!--<rule id="TAG-259-0004" context="ifd[thumbnail=0]" level="error">
            <title>Thumbnail must be uncompressed</title>
            <description>The Compression tag value shall equal "1" for the thumbnail IFD</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>18</page></reference>
            <assert test="{tags.tag[name=Compression] == 1} || {tags.tag[name=Compression] == 7} || {tags.tag[name=Compression] &gt; 32767}"></assert>
        </rule>-->
    </rules>
    
    <rules id="TAG-37122">
        <title>CompressedBitsPerPixel</title>
        <description>This optional tag encodes the average number of bits per pixel used to store a compressed image.
        
        Tag = 37122 (9102.H)
        Type = RATIONAL
        N = 1
        </description>
        
        <rule id="TAG-37122-0001" context="tag[id=37122]" level="error">  
            <title>CompressedBitsPerPixel valid Type</title>
            <description>CompressedBitsPerPixel Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>27</page></reference>
            <assert test="{type=='RATIONAL'}">CompressedBitsPerPixel type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-37122-0002" context="tag[id=37122]" level="error">
            <title>CompressedBitsPerPixel valid cardinality</title>
            <description>The cardinality of the CompressedBitsPerPixel tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>27</page></reference>
            <assert test="{cardinality==1}">CompressedBitsPerPixel must have a 1 cardinality</assert>
        </rule>
        
        <rule id="TAG-37122-0003" context="ifd[class=image]" level="error">
            <title>CompressedBitsPerPixel requires compression</title>
            <description>CompressedBitsPerPixel should only be used on compressed images</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>27</page></reference>
            <assert test="{!tags.tag[name=CompressedBitsPerPixel]} || {tags.tag[name=Compression] == 7} || {tags.tag[name=Compression] &gt; 32767}">CompressedBitsPerPixel should only be used on compressed images</assert>
        </rule>
    </rules>
    
    <rules id="TAG-347">
        <title>JPEGTables</title>
        <description>This optional tag may be used to encode the JPEG quantization and Huffman tables for subsequent use by the JPEG decompression process. 
            When this is done, these tables need not be duplicated in each segment (strip or tile), thus saving space and processing time. 
            This tag may be used even in a single-segment file, although there is no space saving in this case.
            When this optional tag is present, it shall contain a valid JPEG "abbreviated table specification" datastream. This datastream shall begin with SOI and end with EOI. It contains one or more JPEG tables, including: DQT, DHT
            
            Tag = 347 (15B.H)
            Type = UNDEFINED
            N = number of bytes in tables datastream (typically a few hundred bytes in length)</description>
        
        <rule id="TAG-347-0001" context="tag[id=347]" level="error">  
            <title>JPEGTables valid Type</title>
            <description>JPEGTables Tag type must be UNDEFINED</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>28</page></reference>
            <assert test="{type=='UNDEFINED'}">JPEGTables type is not valid, an UNDEFINED type is expected</assert>
        </rule>
        <rule id="TAG-347-0002" context="ifd[class=image]" level="error">
            <title>JPEGTables only with JPEG compression</title>
            <description>JPEGTables should only be used with JPEG compression</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>28</page></reference>
            <assert test="{tags.tag[name=Compression] != 7} || {tags.tag[name=JPEGTables]}">JPEGTables should only be used with JPEG compression</assert>
        </rule>
    </rules>
    
    <rules id="TAG-37395">
        <title>ImageHistory</title>
        <description>This optional tag encodes a record of what has been done to the image. 
            The current information shall not be erased when adding new information to the image history.
            As changes are made, the additional information about the changes should be concatenated to the previous string. 
            The new information should be separated by one or more ASCII blank spaces and terminated with a NULL zero byte.
            
            Tag = 37395 (13B.H)
            Type = ASCII
            No default</description>
        
        <rule id="TAG-37395-0001" context="tag[id=37395]" level="error">
            <title>ImageHistory tag valid Type</title>
            <description>ImageHistory Tag type must be ASCII</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>33</page></reference>
            <assert test="{type=='ASCII'}">ImageHistory Tag type is not valid, an ASCII type is expected</assert>
        </rule>
    </rules>
    
    <rules id="TAG-33723">
        <title>IPTC/NAA</title>
        <description>This optional tag may be used to encode relevant information concerning the image that is useful for newspaper photographs. The information is defined in Application Record No. 2 of the IPTC-NAA (International Press Telecommunications Council - Newspaper Association of America) Information Interchange Model and Digital Newsphoto Parameter Record, Version 2, April 14, 1993.
            
            Tag = 33723 (83BB.H)
            Type = LONG or ASCII
            N = any (actual size of the Application Record data in bytes)
            No default</description>
        
        <rule id="TAG-33723-0001" context="tag[id=33723]" level="error">
            <title>IPTC/NAA tag valid Type</title>
            <description>IPTC/NAA Tag type must be LONG or ASCII</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>33</page></reference>
            <assert test="{type=='ASCII'} || {type='LONG'}">IPTC/NAA Tag type is not valid, an LONG or ASCII type is expected</assert>
        </rule>
    </rules>
    
    <rules id="TAG-37394">
        <title>SecurityClassification</title>
        <description>This optional tag encodes the level of security classification assigned to the image. 
            The tag value can either be a single ASCII character or an ASCII string.
            
            Tag = 37394 (9212.H)
            Type = ASCII
            N = 1 or any
            No default</description>
        
        <rule id="TAG-37394-0001" context="tag[id=37394]" level="error">
            <title>IPTC/NAA tag valid Type</title>
            <description>IPTC/NAA Tag type must be ASCII</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>33</page></reference>
            <assert test="{type=='ASCII'}">IPTC/NAA Tag type is not valid, an ASCII type is expected</assert>
        </rule>
    </rules>
    
    <rules id="TAG-34853">
        <title>GPSInfo</title>
        <description>This optional tag-field is used to indicate the position of the camera via data provided by a Global Positioning System (GPS) satellite receiver. 
            The format of this tag-field is a "private IFD". This means that this tag-field points to the offset of an IFD that holds a group of private GPSInfo tag-fields which contain the GPS data.
            
            Tag = 34853 (8825.H)
            Type = LONG
            N = 1
            No default</description>
        
        <rule id="TAG-34853-0001" context="tag[id=34853]" level="error">
            <title>GPSInfo tag valid Type</title>
            <description>GPSInfo Tag type must be LONG</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>34</page></reference>
            <assert test="{type=='LONG'}">GPSInfo Tag type is not valid, an LONG type is expected</assert>
        </rule>
        
        <rule id="TAG-34853-0002" context="tag[id=34853]" level="error">
            <title>GPSInfo valid cardinality</title><description>Check valid cardinality for tag GPSInfo, cardinality must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>34</page></reference>
            <assert test="{cardinality == 1}">GPSInfo cardinality must be 1</assert>
        </rule>
    </rules>
    
    <rules id="TAG-0">
        <title>GPSVersionID</title>
        <description>encodes the version of this GPSInfo IFD as a four tier revision number, for example
            2.0.0.0, using 4 BYTES. This revision number has the form of w.x.y.z where w=0-255, x=0-255, y=0-255 and z=0-
            255. The present version is 2.0.0.0, to maintain compatibility with the Exif 2 specification.
            
            Tag = 0 (0.H)
            Type = BYTE
            N = 4
            Value = 2000
        </description>
        
        <rule id="TAG-0-0001" context="tag[id=0]" level="error">
            <title>GPSVersionID valid Type</title>
            <description>GPSVersionID Tag type must be BYTE</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>35</page></reference>
            <assert test="{type=='BYTE'}">GPSVersionID type is not valid, an BYTE type is expected</assert>
        </rule>
        
        <rule id="TAG-0-0002" context="tag[id=0]" level="error">
            <title>GPSVersionID valid cardinality</title>
            <description>The cardinality of the GPSVersionID tag must be 4</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>35</page></reference>
            <assert test="{cardinality==4}">GPSVersionID must have a 4 cardinality</assert>
        </rule>
        
        <rule id="TAG-0-0003" context="ifd[class=GPS]" level="error" experimental="true">
            <title>GPSVersionID valid value</title>
            <description>GPSVersionID must contain a valid value</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>35</page></reference>
            <assert test="{tags.tag[name=TIFFEPStandardID] == '2,0,0,0'}">GPSVersionID tag must contain a valid value 2000 defining the current GPS info version</assert>
        </rule>
    </rules>
    
    <rules id="TAG-1">
        <title>GPSLatitudeRef</title>
        <description>This optional tag encodes the level of security classification assigned to the image. 
            The tag value can either be a single ASCII character or an ASCII string.
            
            Tag = 1 (1.H)
            Type = ASCII
            N = 2
            No default</description>
        
        <rule id="TAG-1-0001" context="tag[id=1]" level="error">
            <title>GPSLatitudeRef tag valid Type</title>
            <description>GPSLatitudeRef Tag type must be ASCII</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>35</page></reference>
            <assert test="{type=='ASCII'}">GPSLatitudeRef Tag type is not valid, an ASCII type is expected</assert>
        </rule>
        
        <rule id="TAG-1-0002" context="tag[id=1]" level="error">
            <title>GPSLatitudeRef valid cardinality</title>
            <description>The cardinality of the GPSLatitudeRef tag must be 2</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>35</page></reference>
            <assert test="{cardinality==2}">GPSLatitudeRef must have a 2 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-2">
        <title>GPSLatitude</title>
        <description>tag-value contains 3 RATIONAL values equal to the degrees, the minutes and the seconds
            respectively of the camera’s latitude. When degrees, minutes and seconds are used, the format is dd/1, mm/1,
            ss/1. When degrees and minutes are used, and, for example, fractions of minutes are expressed using two decimal
            places, the format is dd/1, mmmm/100 and 0/1.
            
            Tag = 2 (2.H)
            Type = RATIONAL
            N = 3
            No default</description>
        <rule id="TAG-2-0001" context="tag[id=2]" level="error">
            <title>GPSLatitude tag valid Type</title>
            <description>GPSLatitude Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>35</page></reference>
            <assert test="{type=='RATIONAL'}">GPSLatitude Tag type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-2-0002" context="tag[id=2]" level="error">
            <title>GPSLatitude valid cardinality</title>
            <description>The cardinality of the GPSLatitude tag must be 3</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>35</page></reference>
            <assert test="{cardinality==3}">GPSLatitude must have a 3 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-3">
        <title>GPSLongitudeRef</title>
        <description>tag-value is an ASCII value of "E" for east longitudes and "W" for west longitudes relative
            to the International Prime Meridian which is located by the astronomical observatory in Greenwich, UK.
            
            Tag = 3 (3.H)
            Type = ASCII
            N = 2
            No default</description>
        
        <rule id="TAG-3-0001" context="tag[id=3]" level="error">
            <title>GPSLongitudeRef tag valid Type</title>
            <description>GPSLongitudeRef Tag type must be ASCII</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{type=='ASCII'}">GPSLongitudeRef Tag type is not valid, an ASCII type is expected</assert>
        </rule>
        
        <rule id="TAG-3-0002" context="tag[id=3]" level="error">
            <title>GPSLongitudeRef valid cardinality</title>
            <description>The cardinality of the GPSLongitudeRef tag must be 2</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{cardinality==2}">GPSLongitudeRef must have a 2 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-4">
        <title>GPSLongitude</title>
        <description>tag value contains 3 RATIONAL values equal to the degrees, the minutes and the seconds
            respectively of the camera’s longitude. When degrees, minutes and seconds are used, the format is ddd/1, mm/1,
            ss/1. When degrees and minutes are used, and, for example, fractions of minutes are expressed using two decimal
            places, the format is ddd/1, mmmm/100 and 0/1.
            
            Tag = 4 (2.H)
            Type = RATIONAL
            N = 3
            No default</description>
        <rule id="TAG-4-0001" context="tag[id=4]" level="error">
            <title>GPSLongitude tag valid Type</title>
            <description>GPSLongitude Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{type=='RATIONAL'}">GPSLongitude Tag type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-4-0002" context="tag[id=4]" level="error">
            <title>GPSLongitude valid cardinality</title>
            <description>The cardinality of the GPSLongitude tag must be 3</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{cardinality==3}">GPSLongitude must have a 3 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-5">
        <title>GPSAltitudeRef</title>
        <description>tag value shall contain a one BYTE value of "0", indicating sea level, for the current version.
            The altitude reading is given in metres relative to sea level.
        
        Tag = 5 (5.H)
        Type = BYTE
        N = 1
        No default
        </description>
        
        <rule id="TAG-5-0001" context="tag[id=5]" level="error">
            <title>GPSAltitudeRef tag valid Type</title>
            <description>GPSAltitudeRef Tag type must be BYTE</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{type=='BYTE'}">GPSAltitudeRef Tag type is not valid, an BYTE type is expected</assert>
        </rule>
        
        <rule id="TAG-5-0002" context="tag[id=5]" level="error">
            <title>GPSAltitudeRef valid cardinality</title>
            <description>The cardinality of the GPSAltitudeRef tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{cardinality==1}">GPSAltitudeRef must have a 1 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-6">
        <title>GPSAltitude</title>
        <description>tag value contains a single RATIONAL value equal to the camera’s altitude in metres.
            
            Tag = 6 (6.H)
            Type = RATIONAL
            N = 1
            No default</description>
        <rule id="TAG-6-0001" context="tag[id=6]" level="error">
            <title>GPSLatitude tag valid Type</title>
            <description>GPSLatitude Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{type=='RATIONAL'}">GPSLatitude Tag type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-6-0002" context="tag[id=6]" level="error">
            <title>GPSLatitude valid cardinality</title>
            <description>The cardinality of the GPSLatitude tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{cardinality==1}">GPSLatitude must have a 1 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-7">
        <title>GPSTimeStamp</title>
        <description>tag value shall contain a one BYTE value of "0", indicating sea level, for the current version.
            The altitude reading is given in metres relative to sea level.
        
        Tag = 7 (7.H)
        Type = RATIONAL
        N = 3
        No default</description>
        <rule id="TAG-7-0001" context="tag[id=7]" level="error">
            <title>GPSTimeStamp tag valid Type</title>
            <description>GPSTimeStamp Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{type=='RATIONAL'}">GPSTimeStamp Tag type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-7-0002" context="tag[id=7]" level="error">
            <title>GPSTimeStamp valid cardinality</title>
            <description>The cardinality of the GPSTimeStamp tag must be 3</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{cardinality==3}">GPSTimeStamp must have a 3 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-8">
        <title>GPSSatellites</title>
        <description>tag contains an ASCII string that lists the satellites used to determine the camera position. This
            tag can be used to describe the number of satellites, their ID number, angle of elevation, azimuth, SNR and other
            information in ASCII notation. The format is not specified. If the GPS receiver is incapable of taking measurements,
            the value of this tag must be set to NULL.
        
        Tag = 8 (8.H)
        Type = ASCII
        N = Any
        No default</description>
        <rule id="TAG-8-0001" context="tag[id=8]" level="error">
            <title>GPSSatellites tag valid Type</title>
            <description>GPSSatellites Tag type must be ASCII</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{type=='ASCII'}">GPSSatellites Tag type is not valid, an ASCII type is expected</assert>
        </rule>
    </rules>
    
    <rules id="TAG-9">
        <title>GPStatus</title>
        <description>tag contains a null-terminated ASCII character, where A indicates that the measurement is in
            progress and V indicates that the measurement is interrupted.
        
        Tag = 9 (9.H)
        Type = ASCII
        N = 2
        No default</description>
        <rule id="TAG-9-0001" context="tag[id=9]" level="error">
            <title>GPStatus tag valid Type</title>
            <description>GPStatus Tag type must be ASCII</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{type=='ASCII'}">GPStatus Tag type is not valid, an ASCII type is expected</assert>
        </rule>
        
        <rule id="TAG-9-0002" context="tag[id=9]" level="error">
            <title>GPStatus valid cardinality</title>
            <description>The cardinality of the GPStatus tag must be 2</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{cardinality==2}">GPStatus must have a 2 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-10">
        <title>GPSMeasureMode</title>
        <description>tag contains a null-terminated ASCII character, where 2 indicates that a two-dimensional
            measurement is in progress and 3 indicates that a three-dimensional measurement is in progress.
        
        Tag = 10 (10.H)
        Type = ASCII
        N = 2
        No default</description>
        
        <rule id="TAG-10-0001" context="tag[id=10]" level="error">
            <title>GPSMeasureMode tag valid Type</title>
            <description>GPSMeasureMode Tag type must be ASCII</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{type=='ASCII'}">GPSMeasureMode Tag type is not valid, an ASCII type is expected</assert>
        </rule>
        
        <rule id="TAG-10-0002" context="tag[id=10]" level="error">
            <title>GPSMeasureMode valid cardinality</title>
            <description>The cardinality of the GPSMeasureMode tag must be 2</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{cardinality==2}">GPSMeasureMode must have a 2 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-11">
        <title>Measurement precision</title>
        <description>Measurement precision tag contains a RATIONAL value indicating the GPS DOP (data degree of precision). An HDOP value
            is written during a two-dimensional measurement and a PDOP value is written during a three-dimensional
            measurement.
            
            Tag = 11 (11.H)
            Type = RATIONAL
            N = 1
            No default
        </description>
        <rule id="TAG-11-0001" context="tag[id=11]" level="error">
            <title>GPSDOP tag valid Type</title>
            <description>Measurement precision(GPSDOP) Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{type=='RATIONAL'}">Measurement precision(GPSDOP) Tag type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-11-0002" context="tag[id=11]" level="error">
            <title>GPSDOP valid cardinality</title>
            <description>The cardinality of the Measurement precision(GPSDOP) tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{cardinality==1}">Measurement precision(GPSDOP) must have a 1 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-12">
        <title>GPSSpeedRef</title>
        <description>tag contains a null-terminated ASCII character, where K means kilometres per hour, M means
            miles per hour and N means knots
        
        Tag = 12 (12.H)
        Type = ASCII
        N = 2
        No default</description>
        
        <rule id="TAG-12-0001" context="tag[id=12]" level="error">
            <title>GPSSpeedRef tag valid Type</title>
            <description>GPSSpeedRef Tag type must be ASCII</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{type=='ASCII'}">GPSSpeedRef Tag type is not valid, an ASCII type is expected</assert>
        </rule>
        
        <rule id="TAG-12-0002" context="tag[id=12]" level="error">
            <title>GPSSpeedRef valid cardinality</title>
            <description>The cardinality of the GPSSpeedRef tag must be 2</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{cardinality==2}">GPSSpeedRef must have a 2 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-13">
        <title>GPSSpeed</title>
        <description>tag contains a RATIONAL value indicating the speed of the GPS receiver
        
        Tag = 13 (13.H)
        Type = RATIONAL
        N = 1
        No default</description>
        <rule id="TAG-13-0001" context="tag[id=13]" level="error">
            <title>GPSSpeed tag valid Type</title>
            <description>GPSSpeed Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{type=='RATIONAL'}">GPSSpeed Tag type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-13-0002" context="tag[id=13]" level="error">
            <title>GPSSpeed valid cardinality</title>
            <description>The cardinality of the GPSSpeed tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{cardinality==1}">GPSSpeed must have a 1 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-14">
        <title>GPSTrackRef</title>
        <description>tag contains a null-terminated ASCII character indicating the reference for the direction of the
            GPS receiver. T indicates true direction and M indicates magnetic direction.
        
        Tag = 14 (14.H)
        Type = ASCII
        N = 2
        No default</description>
        
        <rule id="TAG-14-0001" context="tag[id=14]" level="error">
            <title>GPSTrackRef tag valid Type</title>
            <description>GPSTrackRef Tag type must be ASCII</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{type=='ASCII'}">GPSTrackRef Tag type is not valid, an ASCII type is expected</assert>
        </rule>
        
        <rule id="TAG-14-0002" context="tag[id=14]" level="error">
            <title>GPSTrackRef valid cardinality</title>
            <description>The cardinality of the GPSTrackRef tag must be 2</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{cardinality==2}">GPSTrackRef must have a 2 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-15">
        <title>GPSTrack</title>
        <description>tag contains a RATIONAL value indicating the direction of the GPS receiver movement, from
            0/100 to 35999/100.
        
        Tag = 15 (F.H)
        Type = RATIONAL
        N = 1
        No default</description>
        <rule id="TAG-15-0001" context="tag[id=15]" level="error">
            <title>GPSTrack tag valid Type</title>
            <description>GPSTrack Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{type=='RATIONAL'}">GPSTrack Tag type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-15-0002" context="tag[id=15]" level="error">
            <title>GPSTrack valid cardinality</title>
            <description>The cardinality of the GPSTrack tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{cardinality==1}">GPSTrack must have a 1 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-16">
        <title>GPSImgDirectionRef</title>
        <description>tag contains a null-terminated ASCII character indicating the reference for the direction
            of the image when it is captured. T indicates true direction and M indicates magnetic direction.
        
        Tag = 16 (F.10)
        Type = ASCII
        N = 2
        No default</description>
        
        <rule id="TAG-16-0001" context="tag[id=16]" level="error">
            <title>GPSImgDirectionRef tag valid Type</title>
            <description>GPSImgDirectionRef Tag type must be ASCII</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{type=='ASCII'}">GPSImgDirectionRef Tag type is not valid, an ASCII type is expected</assert>
        </rule>
        
        <rule id="TAG-16-0002" context="tag[id=16]" level="error">
            <title>GPSImgDirectionRef valid cardinality</title>
            <description>The cardinality of the GPSImgDirectionRef tag must be 2</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{cardinality==2}">GPSImgDirectionRef must have a 2 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-17">
        <title>GPSImgDirection</title>
        <description>tag contains a RATIONAL value indicating the direction of the image when it was captured,
            from 0/100 to 35999/100.
        
        Tag = 17 (F.11)
        Type = RATIONAL
        N = 1
        No default</description>
        <rule id="TAG-17-0001" context="tag[id=17]" level="error">
            <title>GPSImgDirection tag valid Type</title>
            <description>GPSImgDirection Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{type=='RATIONAL'}">GPSImgDirection Tag type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-17-0002" context="tag[id=17]" level="error">
            <title>GPSImgDirection valid cardinality</title>
            <description>The cardinality of the GPSImgDirection tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{cardinality==1}">GPSImgDirection must have a 1 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-18">
        <title>GPSMapDatum</title>
        <description>tag contains an ASCII character string indicates the geodetic survey data used by the GPS
            receiver. If the survey data is restricted to Japan, the value of this tag is "TOKYO" or "WSG-84".
        
        Tag = 18 (F.12) 
        Type = ASCII
        N = Any
        No default</description>
        <rule id="TAG-18-0001" context="tag[id=18]" level="error">
            <title>GPSMapDatum tag valid Type</title>
            <description>GPSMapDatum Tag type must be ASCII</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{type=='ASCII'}">GPSMapDatum Tag type is not valid, an ASCII type is expected</assert>
        </rule>
    </rules>
    
    <rules id="TAG-19">
        <title>GPSDestLatitudeRef</title>
        <description>tag contains a null-terminated ASCII character indicating the latitude of the destination
            point, where N indicates north latitude and S indicates south latitude.
        
        Tag = 19 (F.13) 
        Type = ASCII
        N = 2
        No default</description>
        
        <rule id="TAG-19-0001" context="tag[id=19]" level="error">
            <title>GPSDestLatitudeRef tag valid Type</title>
            <description>GPSDestLatitudeRef Tag type must be ASCII</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{type=='ASCII'}">GPSDestLatitudeRef Tag type is not valid, an ASCII type is expected</assert>
        </rule>
        
        <rule id="TAG-19-0002" context="tag[id=19]" level="error">
            <title>GPSDestLatitudeRef valid cardinality</title>
            <description>The cardinality of the GPSDestLatitudeRef tag must be 2</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{cardinality==2}">GPSDestLatitudeRef must have a 2 cardinality</assert>
        </rule>
     </rules>
    
    <rules id="TAG-20">
        <title>GPSDestLatitude</title>
        <description>tag value contains 3 RATIONAL values equal to the degrees, the minutes and the seconds
            respectively of the destination point. When degrees, minutes and seconds are used, the format is dd/1, mm/1, ss/1.
            When degrees and minutes are used, and, for example, fractions of minutes are expressed using two decimal
            places, the format is dd/1, mmmm/100 and 0/1.
            
            Tag = 20 (F.14) 
            Type = RATIONAL
            N = 3
            No default</description>
        
        <rule id="TAG-20-0001" context="tag[id=20]" level="error">
            <title>GPSDestLatitude tag valid Type</title>
            <description>GPSDestLatitude Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{type=='RATIONAL'}">GPSDestLatitude Tag type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-20-0002" context="tag[id=20]" level="error">
            <title>GPSDestLatitude valid cardinality</title>
            <description>The cardinality of the GPSDestLatitude tag must be 3</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>36</page></reference>
            <assert test="{cardinality==3}">GPSDestLatitude must have a 3 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-21">
        <title>GPSDestLongitudeRef</title>
        <description>tag contains a null-terminated ASCII character indicating the longitude of the
            destination point, where E indicates east latitude and W indicates west latitude.
        
        Tag = 21 (F.15)  
        Type = ASCII
        N = 2
        No default</description>
        
        <rule id="TAG-21-0001" context="tag[id=21]" level="error">
            <title>GPSDestLongitudeRef tag valid Type</title>
            <description>GPSDestLongitudeRef Tag type must be ASCII</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{type=='ASCII'}">GPSDestLongitudeRef Tag type is not valid, an ASCII type is expected</assert>
        </rule>
        
        <rule id="TAG-21-0002" context="tag[id=21]" level="error">
            <title>GPSDestLongitudeRef valid cardinality</title>
            <description>The cardinality of the GPSDestLongitudeRef tag must be 2</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{cardinality==2}">GPSDestLongitudeRef must have a 2 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-22">
        <title>GPSDestLongitude</title>
        <description>tag value contains 3 RATIONAL values equal to the degrees, the minutes and the
            seconds respectively of the destination point. When degrees, minutes and seconds are used, the format is ddd/1,
            mm/1, ss/1. When degrees and minutes are used, and, for example, fractions of minutes are expressed using two
            decimal places, the format is ddd/1, mmmm/100 and 0/1.
        
        Tag = 22 (F.16)  
        Type = RATIONAL
        N = 3
        No default</description>
        
        <rule id="TAG-22-0001" context="tag[id=22]" level="error">
            <title>GPSDestLongitude tag valid Type</title>
            <description>GPSDestLongitude Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{type=='RATIONAL'}">GPSDestLongitude Tag type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-22-0002" context="tag[id=22]" level="error">
            <title>GPSDestLongitude valid cardinality</title>
            <description>The cardinality of the GPSDestLongitude tag must be 3</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{cardinality==3}">GPSDestLongitude must have a 3 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-23">
        <title>GPSDestBearingRef</title>
        <description>tag contains a null-terminated ASCII character indicating the reference for the bearing to
            the destination point. T indicates true direction and M indicates magnetic direction.
            
            Tag = 23 (F.17) 
            Type = ASCII
            N = 2
            No default</description>
        
        <rule id="TAG-23-0001" context="tag[id=23]" level="error">
            <title>GPSDestBearingRef tag valid Type</title>
            <description>GPSDestBearingRef Tag type must be ASCII</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{type=='ASCII'}">GPSDestBearingRef Tag type is not valid, an ASCII type is expected</assert>
        </rule>
        
        <rule id="TAG-23-0002" context="tag[id=23]" level="error">
            <title>GPSDestBearingRef valid cardinality</title>
            <description>The cardinality of the GPSDestBearingRef tag must be 2</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{cardinality==2}">GPSDestBearingRef must have a 2 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-24">
        <title>GPSDestBearing</title>
        <description>tag contains a null-terminated ASCII character indicating the reference for the bearing to
            the destination point. T indicates true direction and M indicates magnetic direction.
        
        Tag = 24 (F.18) 
        Type = RATIONAL
        N = 1
        No default</description>
        <rule id="TAG-24-0001" context="tag[id=24]" level="error">
            <title>GPSDestBearing tag valid Type</title>
            <description>GPSDestBearing Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{type=='RATIONAL'}">GPSDestBearing Tag type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-24-0002" context="tag[id=24]" level="error">
            <title>GPSDestBearing valid cardinality</title>
            <description>The cardinality of the GPSDestBearing tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{cardinality==1}">GPSDestBearing must have a 1 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-25">
        <title>GPSDestDistanceRef</title>
        <description>tag contains a null-terminated ASCII character, where K means kilometres, M means
            miles and N means knots.
        
        Tag = 25 (F.19) 
        Type = ASCII
        N = 2
        No default</description>
        
        <rule id="TAG-25-0001" context="tag[id=25]" level="error">
            <title>GPSDestDistanceRef tag valid Type</title>
            <description>GPSDestDistanceRef Tag type must be ASCII</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{type=='ASCII'}">GPSDestDistanceRef Tag type is not valid, an ASCII type is expected</assert>
        </rule>
        
        <rule id="TAG-25-0002" context="tag[id=25]" level="error">
            <title>GPSDestDistanceRef valid cardinality</title>
            <description>The cardinality of the GPSDestDistanceRef tag must be 2</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{cardinality==2}">GPSDestDistanceRef must have a 2 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-26">
        <title>GPSDestDistance</title>
        <description>tag contains a RATIONAL value indicating the distance to the destination point.
        
        Tag = 25 (F.1A)
        Type = RATIONAL
        N = 1
        No default</description>
        <rule id="TAG-26-0001" context="tag[id=26]" level="error">
            <title>GPSDestDistance tag valid Type</title>
            <description>GPSDestDistance Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{type=='RATIONAL'}">GPSDestDistance Tag type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-26-0002" context="tag[id=26]" level="error">
            <title>GPSDestDistance valid cardinality</title>
            <description>The cardinality of the GPSDestDistance tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{cardinality==1}">GPSDestDistance must have a 1 cardinality</assert>
        </rule>
    </rules>
    
    <rules id="TAG-36867">
        <title>DateTimeOriginal</title>
        <description>This mandatory tag encodes the date and time when the original image was photographed. This tag should never
            be changed after it is written in the camera or image-capture device.
            
            Data time format must be YYYY:MM:DD HH:MM:SS , with hours 0-24, a space character between the date and time and a null-termination
            byte. If the camera has no clock, or the clock is disabled, the time should be indicated as 0000:00:00 00:00:00
        
        Tag = 36867 (9003.H)
        Type = ASCII
        N = 20</description>
       
        <rule id="TAG-36867-0001" context="tag[id=36867]" level="error">
            <title>DateTimeOriginal tag valid Type</title>
            <description>DateTimeOriginal Tag type must be ASCII</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{type=='ASCII'}">DateTimeOriginal Tag type is not valid, an ASCII type is expected</assert>
        </rule>
        
        <rule id="TAG-36867-0002" context="tag[id=36867]" level="error">
            <title>DateTimeOriginal valid cardinality</title>
            <description>The cardinality of the DateTimeOriginal tag must be 20</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{cardinality==20}">DateTimeOriginal cardinality is not valid, cardinality should be 20</assert>
        </rule>
        
        <rule id="TAG-36867-0003" context="ifd[IFD0=1]" level="error">
            <title>DateTimeOriginal valid format</title>
            <description>The format is: "YYYY:MM:DD HH:MM:SS", with hours like those on a 24-hour
                clock, and one space character between the date and the time</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{date(tags.tag[name=DateTimeOriginal])} || {tags.tag[name=DateTimeOriginal] = '0000:00:00 00:00:00'}">Incorrect format for DateTimeOriginal</assert>
        </rule>
        
        <rule id="TAG-36867-0004" context="ifd[IFD0=1]" level="error">
            <title>DateTimeOriginal must be use in the first IFD</title>
            <description>DateTimeOriginal tag must be used in the first IFD</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{tags.tag[name=DateTimeOriginal]}">DateTimeOriginal tag must be used in the first IFD</assert>
        </rule>
        
        <rule id="TAG-36867-0005" context="ifd[class=image]" level="error" >
            <title>DateTimeOriginal should only be used in first IFD</title>
            <description>DateTimeOriginal should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=DateTimeOriginal]}">DateTimeOriginal should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-306">
        <title>DateTime</title>
        <description>This mandatory tag encodes the date and time when the image was last modified.
            
            Tag = 306 (132.H)
            Type = ASCII
            N = 20
        </description>
        <rule id="TAG-306-1-0001" context="ifd[IFD0=1]" level="error">
            <title>DateTime valid format</title>
            <description>The format is: "YYYY:MM:DD HH:MM:SS", with hours like those on a 24-hour
                clock, and one space character between the date and the time</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{date(tags.tag[name=DateTime])} || {tags.tag[name=DateTime] = '0000:00:00 00:00:00'}">Incorrect format for DateTime</assert>
        </rule>
        
        <rule id="TAG-306-1-0002" context="ifd[IFD0=1]" level="error">
            <title>DateTime must be use in the first IFD</title>
            <description>DateTime tag must be used in the first IFD</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{tags.tag[name=DateTime]}">DateTime tag must be used in the first IFD</assert>
        </rule>
        
        <rule id="TAG-306-1-0003" context="ifd[class=image]" level="error" >
            <title>DateTime should only be used in first IFD</title>
            <description>DateTime should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>37</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=DateTime]}">DateTime should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-34858">
        <title>TimeZoneOffset</title>
        <description>This optional tag encodes the time zone of the camera clock (relative to Greenwich Mean Time) used to create the
            DataTimeOriginal tag-value when the picture was taken. It may also contain the time zone offset of the clock used
            to create the DateTime tag-value when the image was modified.
            
            Tag Name = TimeZoneOffset
            Tag = 34858 (882A.H)
            Type = SSHORT
            N = 1 or 2
            
            The allowed values are –12 to +11.
            SSHORT 0 Time Zone Offset (in hours) of DateTimeOriginal tag-value relative to Greenwich Mean Time
            SSHORT 1 If present, Time Zone Offset (in hours) of DateTime tag-value relative to Greenwich Mean Time</description>
        
        <rule id="TAG-34858-0001" context="tag[id=34858]" level="error">
            <title>TimeZoneOffset tag valid Type</title>
            <description>TimeZoneOffset Tag type must be SSHORT</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>38</page></reference>
            <assert test="{type=='SSHORT'}">TimeZoneOffset Tag type is not valid, an SSHORT type is expected</assert>
        </rule>
        
        <rule id="TAG-34858-0002" context="tag[id=34858]" level="error">
            <title>TimeZoneOffset valid cardinality</title>
            <description>The cardinality of the TimeZoneOffset tag must be 1 or 2</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>38</page></reference>
            <assert test="{cardinality==1} || {cardinality==2}">TimeZoneOffset cardinality is not valid, cardinality should be 1 or 2</assert>
        </rule>
        
        <rule id="TAG-34858-0003" context="tag[IFD0=1]" level="error" experimental="true">
            <title>TimeZoneOffset valid values</title>
            <description>The valees of the TimeZoneOffset tag must between -12 and +11</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>38</page></reference>
            <assert test="">TimeZoneOffset value is not valid, values should be between -12 and +11</assert>
        </rule>
        
        <rule id="TAG-34858-0004" context="ifd[class=image]" level="error" >
            <title>TimeZoneOffset should only be used in first IFD</title>
            <description>TimeZoneOffset should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>38</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=TimeZoneOffset]}">TimeZoneOffset should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-33434">
        <title>ExposureTime</title>
        <description>This optional tag encodes the actual exposure time used when the image was captured. The units are (fractional)
            seconds. For example, an exposure time of 1/60 second is encoded as 1/60. The exposure time may be specified
            by using a single number, if the exact value is known. Alternatively, two values may be used to indicate the range
            of uncertainty in the exposure time setting. In this case, the first value shall be the minimum time and the second
            value shall be the maximum time.
            
            Rational 0  Exact Exposure Time, if only one value is present Minimum Exposure Time of the range of uncertainty, if two values are present.
            Rational 1 Maximum Exposure Time of the range of uncertainty, if two values are present.
        
        Tag = 33434 (829A.H)
        Type = RATIONAL
        N = 1 or 2
        </description>
        <rule id="TAG-33434-0001" context="tag[id=33434]" level="error">
            <title>ExposureTime tag valid Type</title>
            <description>ExposureTime Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>38</page></reference>
            <assert test="{type=='RATIONAL'}">ExposureTime Tag type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-33434-0002" context="tag[id=33434]" level="error">
            <title>ExposureTime valid cardinality</title>
            <description>The cardinality of the ExposureTime tag must be 1 or 2</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>38</page></reference>
            <assert test="{cardinality==1} || {cardinality==2}">ExposureTime cardinality is not valid, cardinality should be 1 or 2</assert>
        </rule>
        <rule id="TAG-33434-0003" context="ifd[class=image]" level="error" >
            <title>ExposureTime should only be used in first IFD</title>
            <description>ExposureTime should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>38</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=ExposureTime]}">ExposureTime should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-37377">
        <title>ShutterSpeedValue</title>
        <description>This optional tag encodes the shutter speed value (APEX time value) used when capturing the image. The units
            are APEX (Additive Systems of Photographic Exposure) values.
        
        Tag = 37377 (9201.H)
        Type = RATIONAL
        N = 1
        </description>
        <rule id="TAG-37377-0001" context="tag[id=37377]" level="error">
            <title>ShutterSpeedValue tag valid Type</title>
            <description>ShutterSpeedValue Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>39</page></reference>
            <assert test="{type=='RATIONAL'}">ShutterSpeedValue Tag type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-37377-0002" context="tag[id=37377]" level="error">
            <title>ShutterSpeedValue valid cardinality</title>
            <description>The cardinality of the ShutterSpeedValue tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>39</page></reference>
            <assert test="{cardinality==1}">ShutterSpeedValue cardinality is not valid, cardinality should be 1</assert>
        </rule>
        <rule id="TAG-37377-0003" context="ifd[class=image]" level="error" >
            <title>ShutterSpeedValue should only be used in first IFD</title>
            <description>ShutterSpeedValue should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>39</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=ShutterSpeedValue]}">ShutterSpeedValue should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-33437">
        <title>FNumber</title>
        <description>This optional tag encodes the actual lens f-number (ratio of lens aperture to focal length) used when the image was
            captured. The f-number may be specified by using a single number, if the exact value is known. Alternatively, two
            values may be used to indicate the range of uncertainty in the f-number setting. In this case, the first value shall be
            the minimum f-number and the second value shall be the maximum f-number.
            
            Tag = 33437 (829D.H)
            Type = RATIONAL
            N = 1 or 2
           
           Rational 0 Exact f-number, if only one value is present Minimum f-number of the range of uncertainty, if two values are present
           Rational 1 Maximum f-number of the range of uncertainty, if two values are present
        </description>
        
        <rule id="TAG-33437-0001" context="tag[id=33437]" level="error">
            <title>FNumber tag valid Type</title>
            <description>FNumber Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>39</page></reference>
            <assert test="{type=='RATIONAL'}">FNumber Tag type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-33437-0002" context="tag[id=33437]" level="error">
            <title>FNumber valid cardinality</title>
            <description>The cardinality of the FNumber tag must be 1 or 2</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>39</page></reference>
            <assert test="{cardinality==1} || {cardinality==2}">FNumber cardinality is not valid, cardinality should be 1 or 2</assert>
        </rule>
        <rule id="TAG-33437-0003" context="ifd[class=image]" level="error" >
            <title>FNumber should only be used in first IFD</title>
            <description>FNumber should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>39</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=FNumber]}">FNumber should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-37378">
        <title>ApertureValue</title>
        <description>This tag encodes the actual lens aperture (Av) used when capturing the image. The units are APEX. The maximum
            value is 99.99, the minimum value is 0.0. In APEX units, a value of 0.0 corresponds to f/1.0, and a value of 1.0
            corresponds to f/1.4.
            
            Tag = 37378 (9202.H)
            Type = RATIONAL
            N = 1</description>
        
        <rule id="TAG-37378-0001" context="tag[id=37378]" level="error">
            <title>ApertureValue tag valid Type</title>
            <description>ApertureValue Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>39</page></reference>
            <assert test="{type=='RATIONAL'}">ApertureValue Tag type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-37378-0002" context="tag[id=37378]" level="error">
            <title>ApertureValue valid cardinality</title>
            <description>The cardinality of the ApertureValue tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>39</page></reference>
            <assert test="{cardinality==1}">ApertureValue cardinality is not valid, cardinality should be 1</assert>
        </rule>
        <rule id="TAG-37378-0003" context="ifd[class=image]" level="error" >
            <title>ApertureValue should only be used in first IFD</title>
            <description>ApertureValue should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>39</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=ApertureValue]}">ApertureValue should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-37381">
        <title>MaxApertureValue</title>
        <description>This optional tag encodes the maximum possible aperture opening (minimum lens f-number) of the camera or
            image-capturing device, using APEX units. The allowed range is 0.00 to 99.99.
        
        Tag = 37381 (9205.H)
        Type = RATIONAL
        N = 1
        </description>
        
        <rule id="TAG-37381-0001" context="tag[id=37381]" level="error">
            <title>MaxApertureValue tag valid Type</title>
            <description>MaxApertureValue Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>40</page></reference>
            <assert test="{type=='RATIONAL'}">MaxApertureValue Tag type is not valid, an RATIONAL type is expected</assert>
        </rule>
        <rule id="TAG-37381-0002" context="tag[id=37381]" level="error">
            <title>MaxApertureValue valid cardinality</title>
            <description>The cardinality of the MaxApertureValue tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>40</page></reference>
            <assert test="{cardinality==1}">MaxApertureValue cardinality is not valid, cardinality should be 1</assert>
        </rule>
        <rule id="TAG-37381-0003" context="ifd[class=image]" level="error" >
            <title>MaxApertureValue should only be used in first IFD</title>
            <description>MaxApertureValue should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>40</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=MaxApertureValue]}">MaxApertureValue should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-37379">
        <title>BrightnessValue</title>
        <description>This optional tag encodes the Brightness Value (BV) that was measured when the image was captured, using
            APEX units. The expected maximum value is approximately 13.00 corresponding to a picture taken of a snow
            scene on a sunny day and the expected minimum value is approximately -3.00 corresponding to a night scene. The
            Brightness Value may be specified by using a single number, if the exact value is known. Alternatively, two values
            may be used to indicate the range of uncertainty in the Brightness Value setting. In this case, the first value shall be
            the minimum value and the second value shall be the maximum value.
        
        Tag = 37379 (9203.H)
        Type = SRATIONAL
        N = 1 or 2
        Value = VALUE_OFFSET (any valid signed rational)
        Rational
        0
        Exact Brightness Value, if only one value is present
        Minimum Brightness Value of the range of uncertainty, if two values are present
        1 Maximum Brightness Value of the range of uncertainty, if two values are present</description>
        
        <rule id="TAG-37379-0001" context="tag[id=37379]" level="error">
            <title>BrightnessValue tag valid Type</title>
            <description>BrightnessValue Tag type must be SRATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>40</page></reference>
            <assert test="{type=='SRATIONAL'}">BrightnessValue Tag type is not valid, an SRATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-37379-0002" context="tag[id=37379]" level="error">
            <title>BrightnessValue valid cardinality</title>
            <description>The cardinality of the BrightnessValue tag must be 1 or 2</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>40</page></reference>
            <assert test="{cardinality==1} || {cardinality==2}">BrightnessValue cardinality is not valid, cardinality should be 1 or 2</assert>
        </rule>
        <rule id="TAG-37379-0003" context="ifd[class=image]" level="error" >
            <title>BrightnessValue should only be used in first IFD</title>
            <description>BrightnessValue should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>40</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=BrightnessValue]}">BrightnessValue should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-37380">
        <title>ExposureBiasValue</title>
        <description>This optional tag encodes the actual exposure bias (the amount of over- or under-exposure relative to a normal
            exposure as determined by the camera's exposure system) used when capturing the image, using APEX units. The
            range is between -99.99 and 99.99. The exposure bias may be specified by using a single number, if the value is
            exactly known. Alternatively, two values may be used to indicate the range of uncertainty in the exposure bias
            setting. In this case, the first value shall be the minimum value and the second value shall be the maximum value.
            Tag Name = ExposureBiasValue
            Tag = 37380 (9204.H)
            Type = SRATIONAL
            N = 1 or 2
            Rational
            0
            Exact Exposure Bias, if only one value is present
            Minimum Exposure Bias of the range of uncertainty, if two values are present
            1 Maximum Exposure Bias of the range of uncertainty, if two values are present
        </description>
        <rule id="TAG-37380-0001" context="tag[id=37380]" level="error">
            <title>ExposureBiasValue tag valid Type</title>
            <description>ExposureBiasValue Tag type must be SRATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>40</page></reference>
            <assert test="{type=='SRATIONAL'}">ExposureBiasValue Tag type is not valid, an SRATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-37380-0002" context="tag[id=37380]" level="error">
            <title>ExposureBiasValue valid cardinality</title>
            <description>The cardinality of the ExposureBiasValue tag must be 1 or 2</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>40</page></reference>
            <assert test="{cardinality==1} || {cardinality==2}">ExposureBiasValue cardinality is not valid, cardinality should be 1 or 2</assert>
        </rule>
        <rule id="TAG-37380-0003" context="ifd[class=image]" level="error" >
            <title>ExposureBiasValue should only be used in first IFD</title>
            <description>ExposureBiasValue should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>40</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=ExposureBiasValue]}">ExposureBiasValue should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-34850">
        <title>ExposureProgram</title>
        <description>This tag encodes the class of exposure program that the camera used at the time when the image was captured.
            Typical exposure programs include normal-program (general-purpose auto-exposure), aperture-priority (user sets
            aperture, camera selects shutter speed to properly expose), shutter-priority (user sets shutter speed, camera
            selects aperture to properly expose), etc.
            Tag Name = ExposureProgram
            Tag = 34850 (8822.H)
            Type = SHORT
            N = 1
        
        Value = VALUE
        0 Unidentified
        1 Manual
        2 Program Normal
        3 Aperture Priority
        4 Shutter Priority
        5 Program Creative (biased toward greater "depth of field")
        6 Program Action (biased toward faster "shutter speed")
        7 Portrait Mode (intended for close-up photos with the background out-of-focus)
        8 Landscape Mode (intended for landscapes with the background in good focus)
        Other values > 32767
        These values are "Vendor Unique" and are not required to be interpreted by others.
        These "private" values need to be obtained from PIMA.
        </description>
        <rule id="TAG-34850-0001" context="tag[id=34850]" level="error">
            <title>ExposureProgram tag valid Type</title>
            <description>ExposureProgram Tag type must be SHORT</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>41</page></reference>
            <assert test="{type=='SHORT'}">ExposureProgram Tag type is not valid, an SHORT type is expected</assert>
        </rule>
        
        <rule id="TAG-34850-0002" context="tag[id=34850]" level="error">
            <title>ExposureProgram valid cardinality</title>
            <description>The cardinality of the ExposureProgram tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>41</page></reference>
            <assert test="{cardinality==1}">ExposureProgram cardinality is not valid, cardinality should be 1</assert>
        </rule>
        <rule id="TAG-34850-0003" context="ifd[IFD0=1]" level="error">
            <title>ExposureProgram valid values</title>
            <description>The values of the ExposureProgram tag should be:
                0 Unidentified
                1 Manual
                2 Program Normal
                3 Aperture Priority
                4 Shutter Priority
                5 Program Creative (biased toward greater "depth of field")
                6 Program Action (biased toward faster "shutter speed")
                7 Portrait Mode (intended for close-up photos with the background out-of-focus)
                8 Landscape Mode (intended for landscapes with the background in good focus)
                Other values > 32767
            </description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>41</page></reference>
            <assert test="{tags.tag[name=ExposureProgram] &gt; -1} &amp;&amp; {tags.tag[name=ExposureProgram] &lt; 9} || {tags.tag[name=ExposureProgram] &gt; 32767}">ExposureProgram tag value is not valid</assert>
        </rule>
        <rule id="TAG-34850-0004" context="ifd[class=image]" level="error" >
            <title>ExposureProgram should only be used in first IFD</title>
            <description>ExposureProgram should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>41</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=ExposureProgram]}">ExposureProgram should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-37383">
        <title>MeteringMode</title>
        <description>This optional tag encodes the metering mode (the camera’s method of spatially weighting the scene luminance
            values to determine the sensor exposure) used when capturing the image.
        
        Tag = 37383 (9207.H)
        Type = SHORT
        N = 1
        
        Value = VALUE
        0 Unidentified
        1 Average
        2 CentreWeightedAverage
        3 Spot
        4 MultiSpot
        Other values >32767
        These values are "Vendor Unique" and are not required to be interpreted by others.
        These private values need to be obtained from the TIFF/EP registry.</description>
        <rule id="TAG-37383-0001" context="tag[id=37383]" level="error">
            <title>MeteringMode tag valid Type</title>
            <description>MeteringMode Tag type must be SHORT</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>41</page></reference>
            <assert test="{type=='SHORT'}">MeteringMode Tag type is not valid, an SHORT type is expected</assert>
        </rule>
        
        <rule id="TAG-37383-0002" context="tag[id=37383]" level="error">
            <title>MeteringMode valid cardinality</title>
            <description>The cardinality of the MeteringMode tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>41</page></reference>
            <assert test="{cardinality==1}">MeteringMode cardinality is not valid, cardinality should be 1</assert>
        </rule>
        <rule id="TAG-37383-0003" context="ifd[IFD0=1]" level="error">
            <title>MeteringMode valid values</title>
            <description>The values of the MeteringMode tag should be:
                0 Unidentified
                1 Average
                2 CentreWeightedAverage
                3 Spot
                4 MultiSpot
                Other values >32767
            </description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>41</page></reference>
            <assert test="{tags.tag[name=MeteringMode] &gt; -1} &amp;&amp; {tags.tag[name=MeteringMode] &lt; 5} || {tags.tag[name=MeteringMode] &gt; 32767}">MeteringMode tag value is not valid</assert>
        </rule>
        <rule id="TAG-37383-0004" context="ifd[class=image]" level="error" >
            <title>MeteringMode should only be used in first IFD</title>
            <description>MeteringMode should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>41</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=MeteringMode]}">MeteringMode should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-37385">
        <title>Flash</title>
        <description>This optional tag encodes whether or not flash was used when the image was captured.
            Tag Name = Flash
            Tag = 37385 (9209.H)
            Type = SHORT
            N = 1
            Value = VALUE (allowed values are listed below). The meaning of each bit of the 16 bit SHORT value is listed
            below:
            Bit 0: Flash Fire Status bit:
            Allowed values are:
            0 Flash did not fire
            1 Flashfired
            5 Flash fired, Flash return not sensed
            7 Flash fired, Flash return sensed
            9 Flash fired, Fill flash mode, Camera has no flash return sensing capability
            13 Flash fired, Fill flash mode, Flash return not sensed
            15 Flash fired, Fill flash mode, Flash return sensed
            16 Flash did not file, Flash "off" mode
            24 Flash did not fire, "Auto" flash mode
            25 Flash fired, "Auto" flash mode, Camera has no flash return sensing capability
            29 Flash fired, "Auto" flash mode, Flash return not sensed
            31 Flash fired, "Auto" flash mode, Flash return sensed
            32 Camera does not have a flash unit
            Usage: IFD0
        </description>
        <rule id="TAG-37385-0001" context="tag[id=37385]" level="error">
            <title>Flash tag valid Type</title>
            <description>Flash Tag type must be SHORT</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>42</page></reference>
            <assert test="{type=='SHORT'}">Flash Tag type is not valid, an SHORT type is expected</assert>
        </rule>
        
        <rule id="TAG-37385-0002" context="tag[id=37385]" level="error">
            <title>Flash valid cardinality</title>
            <description>The cardinality of the Flash tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>42</page></reference>
            <assert test="{cardinality==1}">Flash cardinality is not valid, cardinality should be 1</assert>
        </rule>
        <rule id="TAG-37385-0003" context="ifd[IFD0=1]" level="error">
            <title>Flash valid values</title>
            <description>The values of the Flash tag should be:
                0 Unidentified
                1 Average
                2 CentreWeightedAverage
                3 Spot
                4 MultiSpot
                Other values >32767
            </description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>42</page></reference>
            <assert test="{tags.tag[name=Flash] &gt; -1} &amp;&amp; {tags.tag[name=Flash] &lt; 5} || {tags.tag[name=Flash] &gt; 32767}">Flash tag value is not valid</assert>
        </rule>
        <rule id="TAG-37385-0004" context="ifd[class=image]" level="error" >
            <title>Flash should only be used in first IFD</title>
            <description>Flash should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>42</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=Flash]}">Flash should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-37386">
        <title>FocalLength</title>
        <description>This optional tag encodes the lens focal length used to capture the image. The lens focal length unit of measure is
            millimetres. For example, a focal length of 50 mm is encoded as 50/1. The focal length may be specified by using a
            single number, for a fixed focal length lens or a zoom lens, if the zoom lens position is known. Alternatively, two
            values may be used to indicate the range of uncertainty in the focal length setting. In this case, the first value shall
            be the minimum focal length and the second value shall be the maximum focal length.
            
            Tag Name = FocalLength
            Tag = 37386 (920A.H)
            Type = RATIONAL
            N = 1 or 2
            Value = VALUE_OFFSET (any valid rational)
            Rational
            0
            Exact Focal Length, if only one value is present
            Minimum Focal Length of the range of uncertainty, if two values are present
            1 Maximum Focal Length of the range of uncertainty, if two values are present
        </description>
        <rule id="TAG-37386-0001" context="tag[id=37386]" level="error">
            <title>FocalLength tag valid Type</title>
            <description>FocalLength Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>44</page></reference>
            <assert test="{type=='RATIONAL'}">FocalLength Tag type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-37386-0002" context="tag[id=37386]" level="error">
            <title>FocalLength valid cardinality</title>
            <description>The cardinality of the FocalLength tag must be 1 or 2</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>44</page></reference>
            <assert test="{cardinality==1} || {cardinality==2}">FocalLength cardinality is not valid, cardinality should be 1 or 2</assert>
        </rule>
        <rule id="TAG-37386-0003" context="ifd[class=image]" level="error" >
            <title>FocalLength should only be used in first IFD</title>
            <description>FocalLength should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>44</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=FocalLength]}">FocalLength should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-37382">
        <title>SubjectDistance</title>
        <description>This optional tag encodes the distance (in metres) between the front nodal plane of the lens and the position at
            which the camera was focusing when the image was captured. RATIONAL values are used, so that a subject
            distance of 8 metres is encoded as 8/1. Note that the camera may have focused on a subject within the scene
            which may not have been the primary subject. The subject distance may be specified by using a single number, if
            the value is exactly known. Alternatively, two values may be used to indicate the range of uncertainty in the subject
            distance setting. In this case, the first value shall be the minimum value and the second shall be the maximum
            value. A subject distance of infinity is indicated by using -1/1.
            Tag Name = SubjectDistance
            Tag = 37382 (9206.H)
            Type = SRATIONAL
            N = 1 or 2
            Rational
            0
            Exact Subject Distance, if only one value is present
            Minimum Subject Distance of the range of uncertainty, if two values are present
            1 Maximum Subject Distance of the range of uncertainty, if two values are present
        </description>
        <rule id="TAG-37382-0001" context="tag[id=37382]" level="error">
            <title>SubjectDistance tag valid Type</title>
            <description>SubjectDistance Tag type must be SRATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>44</page></reference>
            <assert test="{type=='SRATIONAL'}">SubjectDistance Tag type is not valid, an SRATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-37382-0002" context="tag[id=37382]" level="error">
            <title>SubjectDistance valid cardinality</title>
            <description>The cardinality of the SubjectDistance tag must be 1 or 2</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>44</page></reference>
            <assert test="{cardinality==1} || {cardinality==2}">SubjectDistance cardinality is not valid, cardinality should be 1 or 2</assert>
        </rule>
        <rule id="TAG-37382-0003" context="ifd[class=image]" level="error" >
            <title>SubjectDistance should only be used in first IFD</title>
            <description>SubjectDistance should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>44</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=SubjectDistance]}">SubjectDistance should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-37396">
        <title>SubjectLocation</title>
        <description>This optional tag identifies the approximate location of the subject in the scene. The subject location may be
            specified as a point, a circle or a rectangle. In all cases, the first two values provide the X column number and
            Y row number that corresponds to the centre of the subject location. If three values are given, the third value is the
            diameter of a circle centred at the point specified by the first two values. If four values are given, the third value is
            the width and the fourth value is the height of a rectangle centred at the point specified by the first two values.
            Tag Name = SubjectLocation
            Tag = 37396 (9214.H)
            Type = SHORT
            N = 2 or 3 or 4
            Value = VALUE or VALUE_OFFSET
            Short 0 X column number
            Short 1 Y row number
            Short 2
            If 3 values, this value represents the diameter of a circle centred at the point defined by shorts 0 and 1.
            If 4 values, this value represents the width of a rectangle centred at the point defined by shorts 0 and 1.
            Short 3 This value represents the height of a rectangle centred at the point defined by shorts 0, 1</description>
        <rule id="TAG-37396-0001" context="tag[id=37396]" level="error">
            <title>SubjectLocation tag valid Type</title>
            <description>SubjectLocation Tag type must be SHORT</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>45</page></reference>
            <assert test="{type=='SHORT'}">SubjectLocation Tag type is not valid, an SHORT type is expected</assert>
        </rule>
        
        <rule id="TAG-37396-0002" context="tag[id=37396]" level="error">
            <title>SubjectLocation valid cardinality</title>
            <description>The cardinality of the SubjectLocation tag must be 2,3 or 4</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>45</page></reference>
            <assert test="{cardinality==2} || {cardinality==3}  || {cardinality==4}">SubjectLocation cardinality is not valid, cardinality should be 2,3 or 4</assert>
        </rule>
        <rule id="TAG-37396-0003" context="ifd[class=image]" level="error" >
            <title>SubjectLocation should only be used in first IFD</title>
            <description>SubjectLocation should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>45</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=SubjectLocation]}">SubjectLocation should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-34859">
        <title>SelfTimerMode</title>
        <description>This optional tag encodes the number of seconds the image capture was delayed from the time the "take picture
            button" was pressed by the camera operator. If the value is zero, this implies that the self-timer is off.
            
            Tag Name = SelfTimerMode
            Tag = 34859 (882B.H)
            Type = SHORT
            N = 1
        
        </description>
        <rule id="TAG-34859-0001" context="tag[id=34859]" level="error">
            <title>SelfTimerMode tag valid Type</title>
            <description>SelfTimerMode Tag type must be SHORT</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>45</page></reference>
            <assert test="{type=='SHORT'}">SelfTimerMode Tag type is not valid, an SHORT type is expected</assert>
        </rule>
        
        <rule id="TAG-34859-0002" context="tag[id=34859]" level="error">
            <title>SelfTimerMode valid cardinality</title>
            <description>The cardinality of the SelfTimerMode tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>45</page></reference>
            <assert test="{cardinality==1}">SelfTimerMode cardinality is not valid, cardinality should be 1</assert>
        </rule>
        
        <rule id="TAG-34859-0004" context="ifd[class=image]" level="error" >
            <title>SelfTimerMode should only be used in first IFD</title>
            <description>SelfTimerMode should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>45</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=SelfTimerMode]}">SelfTimerMode should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-33423">
        <title>BatteryLevel</title>
        <description>This tag preferably encodes the camera’s battery level as a ratio of fullness at the time of image capture. For
            example, a full battery level is indicated by 1/1, half-full battery by 1/2, etc. Alternatively, an ASCII string describing
            the battery level is allowed.
            
            Tag = 33423 (828F.H)
            Type = RATIONAL or ASCII
            N = 1 (if RATIONAL) or any (ASCII string count including null-terminating byte)
            Value = VALUE_OFFSET
            Usage: IFD0
        </description>
        <rule id="TAG-33423-0001" context="tag[id=33423]" level="error">
            <title>BatteryLevel tag valid Type</title>
            <description>BatteryLevel Tag type must be RATIONAL or ASCII</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>45</page></reference>
            <assert test="{type=='RATIONAL'} || {type=='ASCII'}">BatteryLevel Tag type is not valid, an RATIONAL or ASCII type is expected</assert>
        </rule>
        
        <rule id="TAG-33423-0002" context="tag[id=33423]" level="error">
            <title>BatteryLevel valid cardinality</title>
            <description>The cardinality of the BatteryLevel tag must be 1 if RATIONAL is used</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>45</page></reference>
            <assert test="{cardinality!=1} || {type=='RATIONAL'}">BatteryLevel cardinality is not valid, cardinality should be 1</assert>
        </rule>
        
        <rule id="TAG-33423-0003" context="ifd[class=image]" level="error" >
            <title>BatteryLevel should only be used in first IFD</title>
            <description>BatteryLevel should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>45</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=BatteryLevel]}">BatteryLevel should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-37384">
        <title>LightSource</title>
        <description>This optional tag encodes the light source (scene illuminant) that was determined to be present when the image
            was captured.
        
        Tag Name = LightSource
        Tag = 37384 (9208.H)
        Type = SHORT
        N = 1
        Value = VALUE
        NOTE Bit 15 of this 16-bit word is used as the key to whether or not a colour temperature value is being stored. If bit 15 is
        0, then the value described within bits 0 to 14 will provide one of the prescribed colour values depicted in the table below.
        Otherwise, if bit 15 is 1, then bits 0 to 14 contain the actual colour temperature value stored in units of Kelvin. In this case,
        colour temperatures are limited to values in the range of 0 K to 32767 K.
        VALUES (Bit 15 = 0, Bits 14...0 ==> 0...32767)
        0 Unidentified
        1 Daylight
        2 Fluorescent light
        3 Tungsten Lamp
        10 Flash
        17 Standard Illuminant A
        18 Standard Illuminant B
        19 Standard Illuminant C
        20 D55 Illuminant
        21 D65 Illuminant
        22 D75 Illuminant
        Other values &lt; 32768 These values are reserved for use by TIFF/EP
        VALUES (Bit 15 = 1, Bits 14...0 ==> 0...32767)
        0 – 32767
        Depicts the actual colour temperature of the scene illuminant corresponding to values
        of 0 through 32767 K, i.e. the value depicted within bits 0 to 14. Value derived by
        masking off bit 15.
        </description>
        <rule id="TAG-37384-0001" context="tag[id=37384]" level="error">
            <title>LightSource tag valid Type</title>
            <description>LightSource Tag type must be SHORT</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>46</page></reference>
            <assert test="{type=='SHORT'}">LightSource Tag type is not valid, an SHORT type is expected</assert>
        </rule>
        
        <rule id="TAG-37384-0002" context="tag[id=37384]" level="error">
            <title>LightSource valid cardinality</title>
            <description>The cardinality of the LightSource tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>46</page></reference>
            <assert test="{cardinality==1}">LightSource cardinality is not valid, cardinality should be 1</assert>
        </rule>
        
        <rule id="TAG-37384-0004" context="ifd[class=image]" level="error" >
            <title>LightSource should only be used in first IFD</title>
            <description>LightSource should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>46</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=LightSource]}">LightSource should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-34675">
        <title>InterColourProfile</title>
        <description>This tag encodes an embedded InterColour device profile relating to the camera colour characterization. Refer to
            "ICC.1:2001, File Format for Colour Profiles", for further information on the use of this tag. Note that the ICC Profile
            Format may be revised in the future and the most recent version of the ICC specification should be used.
        
        Tag = 34675 (8773.H)
        Type = UNDEFINED
        N = any (actual size of the embedded IC profile in bytes)</description>
        
        <rule id="TAG-34675-0001" context="tag[id=34675]" level="error">
            <title>InterColourProfile tag valid Type</title>
            <description>InterColourProfile Tag type must be UNDEFINED</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>47</page></reference>
            <assert test="{type=='UNDEFINED'}">InterColourProfile Tag type is not valid, an UNDEFINED type is expected</assert>
        </rule>
        
        <rule id="TAG-34675-0002" context="tag[id=34675]" level="error">
            <title>InterColourProfile valid cardinality</title>
            <description>The cardinality of the InterColourProfile tag must be 1</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>47</page></reference>
            <assert test="{cardinality==1}">InterColourProfile cardinality is not valid, cardinality should be 1</assert>
        </rule>
        
        <rule id="TAG-34675-0004" context="ifd[class=image]" level="error" >
            <title>InterColourProfile should only be used in first IFD</title>
            <description>InterColourProfile should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>47</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=ICCProfile]}">InterColourProfile should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-37397">
        <title>ExposureIndex</title>
        <description>This optional tag encodes the camera exposure index setting the camera had selected when the image was
            captured. The Exposure Index may be specified by using a single number if the exact Exposure Index is known.
            Alternatively, two values may be used to indicate the range of uncertainty in the Exposure Index setting. In this
            case, the first value shall be the minimum value and the second shall be the maximum value.
            Tag Name = ExposureIndex
            Tag = 37397 (9215.H)
            Type = RATIONAL
            N = 1 or 2
            Value = VALUE_OFFSET (any rational number)
            Rational
            0
            Exact Exposure Index, if only one value is present
            Minimum Exposure Index of the range of uncertainty, if two values are present
            1 Maximum Exposure Index of the range of uncertainty, if two values are present
            Usage: IFD0</description>
        <rule id="TAG-37397-0001" context="tag[id=37397]" level="error">
            <title>ExposureIndex tag valid Type</title>
            <description>ExposureIndex Tag type must be RATIONAL</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>47</page></reference>
            <assert test="{type=='RATIONAL'}">ExposureIndex Tag type is not valid, an RATIONAL type is expected</assert>
        </rule>
        
        <rule id="TAG-37397-0002" context="tag[id=37397]" level="error">
            <title>ExposureIndex valid cardinality</title>
            <description>The cardinality of the ExposureIndex tag must be 1 or 2</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>47</page></reference>
            <assert test="{cardinality==1} || {cardinality==2}">ExposureIndex cardinality is not valid, cardinality should be 1 or 2</assert>
        </rule>
        <rule id="TAG-37397-0003" context="ifd[class=image]" level="error" >
            <title>ExposureIndex should only be used in first IFD</title>
            <description>ExposureIndex should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>47</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=ExposureIndex]}">ExposureIndex should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-34855">
        <title>ISOSpeedRatings</title>
        <description>This optional tag-field includes the ISO speed and ISO speed latitude values specified in ISO 12232:1998. The first
            value is the ISO speed rating and the last two values are the minimum and maximum ISO speed latitude values.
            Some electronic still-picture cameras may not have an ISO speed latitude.
        
        Tag = 34855 (8827.H)
        Type = SHORT
        N = 1 or
        Value = VALUE
        For the allowed values, see tables indicated above.
        
        
        </description>
        <rule id="TAG-34855-0001" context="tag[id=34855]" level="error">
            <title>ISOSpeedRatings tag valid Type</title>
            <description>ISOSpeedRatings Tag type must be SHORT</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>47</page></reference>
            <assert test="{type=='SHORT'}">ISOSpeedRatings Tag type is not valid, an SHORT type is expected</assert>
        </rule>
        <rule id="TAG-34855-0002" context="ifd[class=image]" level="error" >
            <title>ISOSpeedRatings should only be used in first IFD</title>
            <description>ISOSpeedRatings should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>47</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=ISOSpeedRatings]}">ISOSpeedRatings should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-34856">
        <title>OECF</title>
        <description>This optional tag allows the "Opto-Electronic Conversion Function" (OECF) values described in ISO 14524:1999 to
            be stored as a table of values. The OECF is the relationship between the optical input and the image file code
            value outputs of an electronic camera. The columns of the table can provide the camera OECF values, or the focal
            plane OECF values, or both.
        
        Tag = 34856 (8828.H)
        Type = UNDEFINED
        N = any (actual size of the OECF data in bytes)
        Value = VALUE_OFFSET</description>
        <rule id="TAG-34856-0001" context="tag[id=34856]" level="error">
            <title>OECF tag valid Type</title>
            <description>OECF Tag type must be SHORT</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>48</page></reference>
            <assert test="{type=='SHORT'}">OECF Tag type is not valid, an SHORT type is expected</assert>
        </rule>
        <rule id="TAG-34856-0002" context="ifd[class=image]" level="error" >
            <title>OECF should only be used in first IFD</title>
            <description>OECF should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>48</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=OECF]}">OECF should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-34852">
        <title>SpectralSensitivity</title>
        <description>This optional tag-field can be used to describe the spectral sensitivity of each channel of the camera used to
            capture the image. It is useful for certain scientific applications
            Tag = 34852 (8824.H)
            Type = ASCII
            N = any
        </description>
        <rule id="TAG-34852-0001" context="tag[id=34852]" level="error">
            <title>SpectralSensitivity tag valid Type</title>
            <description>SpectralSensitivity Tag type must be ASCII</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>48</page></reference>
            <assert test="{type=='ASCII'}">SpectralSensitivity Tag type is not valid, an ASCII type is expected</assert>
        </rule>
        <rule id="TAG-34852-0002" context="ifd[class=image]" level="error" >
            <title>SpectralSensitivity should only be used in first IFD</title>
            <description>SpectralSensitivity should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>48</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=SpectralSensitivity]}">SpectralSensitivity should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-37388">
        <title>SpatialFrequencyResponse</title>
        <description>This optional tag encodes the spatial frequency response (SFR) of the camera or image-capturing device. The
            camera measured SFR data described in ISO 12233:2000 can be stored as a table of spatial frequencies,
            horizontal SFR values, vertical SFR values and diagonal SFR values.
            Tag Name = SpatialFrequencyResponse
            Tag = 37388 (920C.H)
            Type = UNDEFINED
            N = (size of the SpatialFrequencyResponse data in bytes)
            Value = VALUE_OFFSET
            Byte 0-1 Number of table columns (N SHORT values)
            Byte 2-3 Number of table rows (M SHORT values)
            Byte 4-x N ASCII null terminated column headings
            Byte x-x+8xNxM NxM RATIONAL entries in row major order (all data of row given first)
            Usage: IFD0
        </description>
        <rule id="TAG-37388-0001" context="tag[id=37388]" level="error">
            <title>SpatialFrequencyResponse tag valid Type</title>
            <description>SpatialFrequencyResponse Tag type must be UNDEFINED</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>49</page></reference>
            <assert test="{type=='UNDEFINED'}">SpatialFrequencyResponse Tag type is not valid, an UNDEFINED type is expected</assert>
        </rule>
        <rule id="TAG-37388-0002" context="ifd[class=image]" level="error" >
            <title>SpatialFrequencyResponse should only be used in first IFD</title>
            <description>SpatialFrequencyResponse should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>49</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=SpatialFrequencyResponse]}">SpatialFrequencyResponse should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="TAG-37389">
        <title>Noise</title>
        <description>This tag encodes camera noise measurement values.
            Tag Name = Noise
            Tag = 37389 (920D.H)
            Type = UNDEFINED
            N = any (actual size of the Noise data in bytes)
            Value = VALUE_OFFSET
        </description>
        <rule id="TAG-37389-0001" context="tag[id=37389]" level="error">
            <title>Noise tag valid Type</title>
            <description>Noise Tag type must be UNDEFINED</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>49</page></reference>
            <assert test="{type=='UNDEFINED'}">Noise Tag type is not valid, an UNDEFINED type is expected</assert>
        </rule>
        <rule id="TAG-37389-0002" context="ifd[class=image]" level="error" >
            <title>Noise should only be used in first IFD</title>
            <description>Noise should only be used in the first Image File Directory(IFD)</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>49</page></reference>
            <assert test="{IFD0==1} || {!tags.tag[name=SpatialFrequencyResponse]}">Noise should only be used in the first IFD</assert>
        </rule>
    </rules>
    
    <rules id="MANDATORY-TAG">
        <title>Mandatory tags for TIFF/EP</title>
        <description>This section describes the list of mandatory tags in TIFF/EP specification</description>
        <rule id="MANDATORY-TAG-0001" context="ifd[class=image]" level="error">
            <title>PlanarConfiguration mandatory tag</title>
            <description>This tag describes how the components (samples) of each pixel are stored. This tag is mandatory and there is no default value.</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>32</page></reference>
            <assert test="{tags.tag[name=PlanarConfiguration]}">PlanarConfiguration is mandatory</assert>
        </rule>
        <rule id="MANDATORY-TAG-0002" context="ifd[class=image]" level="error">
            <title>BitsPerSample mandatory tag</title>
            <description>This tag encodes the number of bits per component for each pixel. This tag is mandatory and there is no default value. This tag provides N values depending upon SamplesPerPixel present.</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>24</page></reference>
            <assert test="{tags.tag[name=BitsPerSample]}">BitsPerSample is mandatory</assert>
        </rule>
        
        <rule id="MANDATORY-TAG-0003" context="ifd[class=image]" level="error">
            <title>RowsPerStrip mandatory for strip images</title>
            <description>This tag encodes the number of rows per strip within the image. This tag is mandatory when the image is stored as strips.</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>25</page></reference>
            <assert test="{strips==0} || {tags.tag[name=RowsPerStrip]}">RowsPerStrip mandatory for strip images</assert>
        </rule>
        
        <rule id="MANDATORY-TAG-0004" context="ifd[class=image]" level="error">
            <title>StripByteCounts mandatory for strip images</title>
            <description>This tag encodes the number of bytes present in each strip after compression has been applied. This tag is mandatory when the image is stored as strips.</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>25</page></reference>
            <assert test="{strips==0} || {tags.tag[name=StripBYTECount]}">StripByteCounts mandatory for strip images</assert>
        </rule>
        
        <rule id="MASTER-0003" context="ifd[strips=1]" level="error" experimental="true">
            <title>64 Kbytes per strip</title>
            <description>It is recommended that the image data, prior to compression, not exceed 64 Kbytes per strip.
                This value is chosen to maximize compatibility with various operating systems.</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>24</page></reference>
            <assert test="{tags.tag[name=Compression] != 0} || {StripsSize &gt; 65536}">It is recommended that the image data, prior to compression, not exceed 64 Kbytes per strip.</assert>
        </rule>
        <rule id="TAG-530-0004" context="ifd[type=YCbCr]" level="error">
            <title>YCbCrSubSampling mandatori for YCbCr images</title>
            <description>YCbCrSubSampling It is mandatory when PhotometricInterpretation = 6, and there are no defaults allowed</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>28</page></reference>
            <assert test="{tags.tag[name=YCbCrSubSampling]}">It is mandatory for YCbCr images and there are no defaults allowed</assert>
        </rule> 
        <rule id="TAG-531-0005" context="ifd[type=YCbCr]" level="error">
            <title>YCbCrPositioning mandatori for YCbCr images</title>
            <description>YCbCrPositioning tag is mandatory when PhotometricInterpretation = 6 and the value shall equal 2.there are no defaults allowed</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>29</page></reference>
            <assert test="{tags.tag[name=YCbCrPositioning]==2}">YCbCrPositioning  is mandatory when PhotometricInterpretation = 6 and the value shall equal 2</assert>
        </rule> 
        <rule id="TAG-529-0005" context="ifd[type=YCbCr]" level="error">
            <title>YCbCrCoefficients mandatori for YCbCr images</title>
            <description>YCbCrCoefficients tag tag is mandatory when PhotometricInterpretation = 6 and there are no defaults allowed.</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>29</page></reference>
            <assert test="{tags.tag[name=YCbCrCoefficients]}">YCbCrCoefficients tag is not defined and is mandatory for YCbCr Images</assert>
        </rule> 
        <rule id="TAG-529-0004" context="ifd[type=YCbCr]" level="info">
            <title>YCbCrCoefficients recommended values CCIR 601-1</title>
            <description>YCbCrCoefficients CCIR Recommendation 601-1: 299/1000, 587/1000 and 114/1000, for LumaRed, LumaGreen and LumaBlue, respectively. </description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>29</page></reference>
            <assert test="{tags.tag[name=YCbCrCoefficients]}">YCbCrCoefficients tag is defined. The values may not follow the CCIR Recommendation 601-1: 299/1000, 587/1000 and 114/1000, for LumaRed, LumaGreen and LumaBlue, respectively.</assert>
        </rule> 
        <rule id="TAG-529-0006" context="ifd[type=YCbCr]" level="info">
            <title>YCbCrCoefficients recommended values CCIR 709</title>
            <description>YCbCrCoefficients CCIR Recommendation 709: 2125/10000, 7154/10000 and 721/10000, for LumaRed, LumaGreen and LumaBlue, respectively. </description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>29</page></reference>
            <assert test="{tags.tag[name=YCbCrCoefficients]}">YCbCrCoefficients tag is defined. The values may not follow the CCIR Recommendation 709: 2125/10000, 7154/10000 and 721/10000, for LumaRed, LumaGreen and LumaBlue, respectively.</assert>
        </rule> 
        <rule id="TAG-532-0002" context="ifd[type=YCbCr]" level="error">
            <title>ReferenceBlackWhite mandatori for YCbCr images</title>
            <description>ReferenceBlackWhite tag is mandatory when PhotometricInterpretation = 6 and there are no defaults allowed.</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>30</page></reference>
            <assert test="{tags.tag[name=ReferenceBlackWhite]}">ReferenceBlackWhite tag is mandatory for YCbCr images</assert>
        </rule>
        <rule id="TAG-532-0003" context="ifd[IFD0=1]" level="error">
            <title>Make tag mandatory</title>
            <description>Make is a mandatory tag with an allowed value of " " (null character) indicating "unknown".</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>31</page></reference>
            <assert test="{tags.tag[name=Make]}">Make tag is mandatory</assert>
        </rule>
        <rule id="TAG-532-0004" context="ifd[IFD0=1]" level="error">
            <title>Model tag mandatory</title>
            <description>Model is a mandatory tag with an allowed value of " " (null character) indicating "unknown".</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>31</page></reference>
            <assert test="{tags.tag[name=Model]}">Model tag is mandatory</assert>
        </rule>
        <rule id="TAG-532-0005" context="ifd[IFD0=1]" level="error">
            <title>Software tag mandatory</title>
            <description>Software is a mandatory tag with an allowed value of " " (null character) indicating "unknown".</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>31</page></reference>
            <assert test="{tags.tag[name=Software]}">Software tag is mandatory</assert>
        </rule>
        <rule id="TAG-532-0006" context="ifd[IFD0=1]" level="error">
            <title>ImageDescription tag mandatory</title>
            <description>ImageDescription is a mandatory tag with an allowed value of " " (null character) indicating "unknown".</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>32</page></reference>
            <assert test="{tags.tag[name=ImageDescription]}">ImageDescription tag is mandatory</assert>
        </rule>
        <rule id="TAG-532-0007" context="ifd[IFD0=1]" level="error">
            <title>Copyright tag mandatory</title>
            <description>Copyright is a mandatory tag with an allowed value of " " (null character) indicating "unknown".</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>32</page></reference>
            <assert test="{tags.tag[name=Copyright]}">Copyright tag is mandatory</assert>
        </rule>
    </rules>
    
    
    <rules id="MASTER">
        <title>Rules to validate IFD Master Image</title>
        <description>The following rules validate a valid ifd storing a master image according to TIFF/EP specifications</description>
        <rule id="MASTER-0001" context="ifd[thumbnail=0]" level="warning">
            <title>Square aspect ration</title>
            <description>In TIFF/EP recommends a pixel aspect ratio is 1:1 (square), so that XResolution equals YResolution</description>
            <reference><document>TIFF/EP</document>
                <section>Section 4.2: Image data</section>
                <page>5</page>
            </reference>
            <assert test="{tags.tag[name=XResolution] != tags.tag[name=YResolution]}">In TIFF/EP the aspect ratio should be is 1:1 (square)</assert>
        </rule>
        
        <rule id="MASTER-0002" context="ifd[class=image]" level="warning" experimental="true">
            <title>64 Kbytes per strip</title>
            <description>It is recommended that the image data, prior to compression, not exceed 64 Kbytes per strip.
                This value is chosen to maximize compatibility with various operating systems.</description>
            <reference><document>TIFF/EP</document>
                <section>Section 4.2: Image data</section>
                <page>5</page>
            </reference>
            <assert test="{tags.tag[name=Compression] != 0} || {StripsSize &gt; 65536}">It is recommended that the image data, prior to compression, not exceed 64 Kbytes per strip.</assert>
        </rule>
        <rule id="MASTER-0004" context="ifd[thumbnail=0]" level="error">
            <title>NewSubFileType defined</title>
            <description>New NewSubFileType tag must be explicit defined in an Image File Directory storing a master image.</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>17</page></reference>
            <assert test="{tags.tag[name=NewSubfileType]}">New NewSubFileType tag must be explicitly defined in an Image File Directory storing a master image.</assert>
        </rule>
        <rule id="MASTER-0005" context="ifd[thumbnail=0]" level="error">
            <title>Valid NewSubFileType</title>
            <description>NewSubFileType tag must define a full resolution image in an Image File Directory storing a master image.</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>17</page></reference>
            <assert test="{tags.tag[name=NewSubfileType]  == 0}">NewSubFileType invalid value for a master image, the value should define a full resolution image.</assert>
        </rule>
       
        <rule id="MASTER-0007" context="ifd[thumbnail=0]" level="error">
            <title>SubIFD not permitted</title>
            <description>TIFF-EP do not permit the use of SubIFDs in a master image.</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>17</page></reference>
            <assert test="{count(tags.tag[name=SubIFDs]) == 0}">TIFF/EP do not permit the use of SubIFDs in a master image</assert>
        </rule>
       
        <rule id="MASTER-0009" context="ifd[thumbnail=0]" level="error">
            <title>Master image with a subIFD thumbnail</title>
            <description>Although TIFF/EP do not recommend the use of thumbnails, when a thumbnails is defined it must contain a subIFD containing the main image.</description>
            <reference><document>TIFF/EP</document>
                <section>Section 4.2: Image data</section>
                <page>6</page>
            </reference>
            <assert test="{tags.tag[name=SubIFDs].ifd.tags.tag[name=NewSubfileType] % 2 == 0}">Invalid IFD structure,The Master image define a subIFD containing a thumbnail</assert>
        </rule>
    </rules>

    <rules id="THUMBNAIL">
        <title>Rules to validate IFD Thumbnail</title>
        <description>This rules section validate a valid thumbnail followin the TIFF/EP specifications</description>

        <rule id="THUMBNAIL-0001" context="ifd[thumbnail=1]" level="warning">
            <title>Thumbnail square aspect ration</title>
            <description>In TIFF/EP recommends aspect ratio is 1:1 (square), so that XResolution equals YResolution</description>
            <reference><document>TIFF/EP</document>
                <section>Section 4.3: Thumbnail images</section>
                <page>6</page>
            </reference>
            <assert test="{tags.tag[name=XResolution] != tags.tag[name=YResolution]}">In TIFF/EP recommends ratio is 1:1 (square)</assert>
        </rule>
        <rule id="THUMBNAIL-0002" context="ifd[thumbnail=1]" level="error">
            <title>Thumbnail strip data Structure</title>
            <description>TIFF/EP requires that the thumbnail image be stored in strips, so that the thumbnails may be read by any baseline TIFF 6.0 reader.  </description>
            <reference><document>TIFF/EP</document>
                <section>Section 4.3: Thumbnail images</section>
                <page>6</page>
            </reference>
            <assert test="{strips == 1}">In TIFF/EP the only data structure supported are strips</assert>
        </rule>
        <rule id="THUMBNAIL-0003" context="ifd[thumbnail=1]" level="warning" experimental="true">
            <title>Thumbnail 64 Kbytes per strip</title>
            <description>It is recommended that the image data, prior to compression, not exceed 64 Kbytes per strip.
                This value is chosen to maximize compatibility with various operating systems.</description>
            <reference><document>TIFF/EP</document>
                <section>Section 4.3: Thumbnail images</section>
                <page>6</page>
            </reference>
            <assert test="{tags.tag[name=Compression] != 0} || {stripsSize &gt; 65536}">It is recommended that the image data, prior to compression, not exceed 64 Kbytes per strip.</assert>
        </rule>
        <rule id="THUMBNAIL-0004" context="ifd[thumbnail=1]" level="error" experimental="true">
            <title>Thumbnail No compression</title>
            <description>It is recommended that the image data, prior to compression, not exceed 64 Kbytes per strip.
                This value is chosen to maximize compatibility with various operating systems.</description>
            <reference><document>TIFF/EP</document>
                <section>Section 4.3: Thumbnail images</section>
                <page>6</page>
            </reference>
            <assert test="{tags.tag[name=Compression] == 0}">It is recommended that the image data, prior to compression, not exceed 64 Kbytes per strip.</assert>
        </rule>
        <rule id="THUMBNAIL-0005" context="ifd[thumbnail=1]" level="error">
            <title>Thumbnail NewSubFileType defined</title>
            <description>NewSubFileType must be defined for TIFF/EP standard TIFF Thumbnail.</description>
             <reference><document>TIFF/EP</document>
                <section>Section 4.3: Thumbnail images</section>
                 <page>6</page>
            </reference>
            <assert test="{tags.tag[name=NewSubfileType]}">NewSubFileType must be defined for TIFF/EP standard TIFF Thumbnail.</assert>
        </rule>
        <rule id="THUMBNAIL-0006" context="ifd[thumbnail=1]" level="error">
            <title>Thumbnail valid NewSubFileType</title>
            <description>NewSubFileType must be propertly defined for TIFF/EP standard TIFF Thumbnail.</description>
            <reference><document>TIFF/EP</document>
                <section>Section 4.3: Thumbnail images</section>
                <page>6</page>
            </reference>
            <assert test="{tags.tag[name=NewSubfileType] == 1}">Thumbnail NewSubFileType must define a thumbnail image</assert>
        </rule>
       
        <rule id="THUMBNAIL-0008" context="ifd[thumbnail=1]" level="error">
            <title>Thumbnail ImageWidth</title>
            <description>The dimensions of the thumbnail image are restricted by TIFF/EP to 256 pixels maximum horizontally and 256 pixels maximum vertically as defined in TIFF/EP.</description>
            <reference><document>TIFF/EP</document>
                <section>Section 4.3: Thumbnail images</section>
                <page>6</page>
            </reference>
            <assert test="{tags.tag[name=ImageWidth] &lt; 256}">The dimensions of the thumbnail image are restricted by TIFF/EP to 256 pixels maximum.</assert>
        </rule>
        <rule id="THUMBNAIL-0009" context="ifd[thumbnail=1]" level="error">
            <title>Thumbnail ImageLength</title>
            <description>The dimensions of the thumbnail image are restricted by TIFF/EP to 256 pixels maximum horizontally and 256 pixels maximum vertically as defined in TIFF/EP.</description>
            <reference><document>TIFF/EP</document>
                <section>Section 4.3: Thumbnail images</section>
                <page>6</page>
            </reference>
            <assert test="{tags.tag[name=ImageLength] &lt; 256}">The dimensions of the thumbnail image are restricted by TIFF/EP to 256 pixels.</assert>
        </rule>
        <rule id="THUMBNAIL-0010" context="ifd[thumbnail=1]" level="error">
            <title>Thumbnail requires SubIFD tag</title>
            <description>Although TIFF/EP do not recommend the use of thumbnails, when a thumbnails is defined it must contain a subIFD containing the main image.</description>
            <reference><document>TIFF/EP</document>
                <section>Section 4.3: Thumbnail images</section>
                <page>6</page>
            </reference>
            <assert test="{count(tags.tag[name=SubIFDs]) == 1}">a thumbnail must contain a Sub-ifd containg the main image</assert>
        </rule>
        <rule id="THUMBNAIL-0014" context="ifd[thumbnail=1]" level="error">
            <title>Thumbnail dimension lower than main image</title>
            <description>The resolution X of the sub image (full resolution) must be greater than the thumbnail image</description>
            <reference><document>TIFF/EP</document>
                <section>Section 4.3: Thumbnail images</section>
                <page>6</page>
            </reference>
            <assert test="{tags.tag[name=SubIFDs].ifd.tags.tag[name=ImageLength] > tags.tag[name=ImageLength]}">Sub-ifd width must be greater than thumbnail IFD</assert>
        </rule>
        <rule id="THUMBNAIL-0012" context="ifd[thumbnail=1]" level="error">
            <title>Thumbnail dimension lower than main image</title>
            <description>The resolution Y of the sub image (full resolution) must be greater than the main (thumbnail) image</description>
            <reference><document>TIFF/EP</document>
                <section>Section 4.3: Thumbnail images</section>
                <page>6</page>
            </reference>
            <assert test="{tags.tag[name=SubIFDs].ifd.tags.tag[name=ImageWidth] > tags.tag[name=ImageWidth]}">Sub-ifd height must be greater than thumbnail IFD</assert>
        </rule>
        <rule id="THUMBNAIL-0013" context="ifd[thumbnail=1]" level="error">
            <title>Thumbnail subIFD contains a full resolution image</title>
            <description>TIFF/EP Thumbnail must define a subIFD containing a full resolution image</description>
            <reference><document>TIFF/EP</document>
                <section>Section 4.3: Thumbnail images</section>
                <page>6</page>
            </reference>
            <assert test="{tags.tag[name=SubIFDs].ifd.tags.tag[name=NewSubfileType] % 2 == 0}">TIFF/EP Thumbnail must define a subIFD containing a full resolution image</assert>
        </rule>
        
    </rules>
    <rules id="forbidden-and-restricted-tags">
        <title>Forbidden and restricted tags</title>
        <description>Forbidden and restricted tags</description>
        <rule id="ep-46" context="ifds.ifd[class=image]" level="error">
            <title>Check valid values for Ycbcr images</title><description>Check valid values for Ycbcr images</description>
            <reference><document>TIFF/EP</document><section>Section 5.2: TIFF/EP tag definitions grouped by function</section><page>29</page></reference>
            <assert test="{correctYcbcr == 1}">Invalid Ycbcr parameters</assert>
        </rule>
        <rule id="ep-47" context="tags" level="error">
            <title>Check forbidden tag PrimaryChromaticities does not exist</title><description>Check forbidden tag PrimaryChromaticities does not exist</description>
            <reference><document>TIFF/EP</document><section>Section 4.5: Camera colour space information</section><page>9</page></reference>
            <assert test="{!tag[name=PrimaryChromaticities]}">PrimaryChromaticities tag is forbidden</assert>
        </rule>
        <rule id="ep-48" context="tags" level="error">
            <title>Check forbidden tag WhitePoint does not exist</title><description>Check forbidden tag WhitePoint does not exist</description>
            <reference><document>TIFF/EP</document><section>Section 4.5: Camera colour space information</section><page>9</page></reference>
            <assert test="{!tag[name=WhitePoint]}">WhitePoint tag is forbidden</assert>
        </rule>
        <rule id="ep-49" context="tags" level="error">
            <title>Check forbidden tag TransferFunction does not exist</title><description>Check forbidden tag TransferFunction does not exist</description>
            <reference><document>TIFF/EP</document><section>Section 4.5: Camera colour space information</section><page>9</page></reference>
            <assert test="{!tag[name=TransferFunction]}">TransferFunction tag is forbidden</assert>
        </rule>
    </rules>

</implementationCheckerObject>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy