Using the utility

Image Compliance provides a utility for migrating TIFF Validation rules defined in a TIFF rules file to a database rule table.

A TIFF rules file specifies which tests are performed during TIFF Validation. It is an XML format defined in TIFF Validation.

The migration utility reads the TIFF rules file and generates a DDL file that is imported to the database by the database administrator. Once it is imported, the DDL file creates a rule set object containing the TIFF rules defined in the TIFF rules file. The program is located in the install_directory\check\v409\ImageCompliance\cmd directory. The migration utility is:
  • For the Windows operating system: MigrTiffRules.bat
  • For AIX®: MigrTiffRules.sh
  • For Linux®: MigrTiffRules.sh
The command syntax is:
MigrTiffRules xxx.xml suspectY suspectN
where,
xxx.xml
Is the TIFF rules file name
suspectY
Is the error code that is used by rules defined with suspect set to yes in the rules file
suspectN
Is the error code that is used by rules defined with suspect set to no in the rules file
The output DDL file has the same name as the input TIFF rules file, except the file extension is different. An example DDL file is shown here:
SET SCHEMA FTM;

INSERT INTO IMAGE_VALIDATION_RULE_SET (VALIDATION_RULE_SET_NAME, 
DESCRIPTION, LAST_UPDATED) VALUES ('RuleSetName', '', current 
timestamp);

INSERT INTO TIFF_IQA_RULES (RULE_TEST_TYPE, TEST_REQUIRED, 
RULES_SET_NAME, ERROR_CODE, TIFF_TAG_NUM, TEST_ID, TEST_VALUE, 
IMAGE_VIEW_TYPE) VALUES (2, 'Y', 'RuleSetName', '112', 0, 201, '07', 0);

INSERT INTO TIFF_IQA_RULES (RULE_TEST_TYPE, TEST_REQUIRED, 
RULES_SET_NAME, TEST_ID, ERROR_CODE, TIFF_TAG_NUM, TEST_VALUE, 
IMAGE_VIEW_TYPE) VALUES (1, 'Y', 'RuleSetName', 101, '1234', 0, 'Y', 0);

COMMIT;

The rule set name is the TIFF rules file name without the XML extension. It can be truncated to the first 15 characters to meet rule set name length restrictions.

Rules can be different for each image view. A TIFF rule defined in the TIFF rules file is migrated to for rule records in a TIFF rule table (one rule record for each view).

Table 1 shows examples of how a test in the TIFF rules file maps to a test record in the database.
Table 1. Test Maps
Example Test Name Tag Number Test value Error Code
<test tiffHeaderRequired="Y" suspect="Y"></test>
TIFF Header Required 0 null suspectY
<test tiffHeaderRequired="N" suspect="N"></test>
TIFF Header Optional 0 null suspectN
<test byteOrder="little" suspect="Y"></test>
Byte Order_Little 0 null suspectY
<test byteOrder="big" suspect="N"></test>
Byte Order_Big 0 null suspectN
<test IFD="valid" suspect="Y"></test>
IFD Valid 0 null suspectY
<test tagOrder="ascending" suspect="y"></test>
Tag Order Ascending 0 null suspectY
<test page="single" suspect="Y"></test>
Single Page 0 null suspectY
<test pointers="valid" suspect="Y"></test>
Pointers Valid 0 null suspectY
<test decompress="G4Only" suspect="Y"></test>
Decompress G4 Only 0 null suspectY
<test decompressLength="G4Only" suspect="Y"></test>
Decompress Len G4 Only 0 null suspectY
<test EOFB="G4Only" suspect="Y"></test>
EOFB G4 Only 0 null suspectY
<test extraPadLimit="G4Only" suspect="Y">0</test>
Extra Pad G4 Only 0 0 suspectY
<tag number="257" name="ImageLength">
    <test mandatory="Y" suspect="Y"></test>
</tag>
Mandatory 257 null suspectY
<tag number="257" name="ImageLength">
    <test operator="NEQ" suspect="N">0</test>
</tag>
Not Equal (Value) 257 0 suspectN
<tag number="273" name="StripOffsets">
    <test field="count" suspect="Y">1</test>
</tag>
IFD Entry Field Count 273 1 suspectY
<tag number="273" name="StripOffsets">
    <test field="type" suspect="Y">3 4</test>
</tag>
IFD Entry Field Type 273 3 4 suspectY
<tag number="283" name="YResolution">
    <test operator="EQ" suspect="Y">200 240</test>
</tag>
Equal (Value) 283 200 240 suspectY
<tag number="283" name=YResolution">
    <test operator="EQ" tagNumber="282" suspect="Y"></test>
</tag>
Equal (Tag Ref) 283 282 suspectY
<tag number="283" name="YResolution">
    <test operator="NEQ" tagNumber="281" suspect="N"></test>
</tag>
Not Equal (Tag Ref) 283 281 suspectN