Home

Open Source x9Tiff.exe

 

X9 Image Compliance

X9.100-181-2007

x9Tiffy.cpp: Like open C source tiffy.c, reads a tiff file, and reports "tags".  Unlike tiffy, it uses C++ class which reports non-compliance with X9 specification X9.100-181-2007.

Note: Image compliance is necessary for "exchange", but some rules have "variances". However, the Federal Reserve Banks (FRB), rules state that you should abide by this standard, therefore, by practicality, these are the rules.

Note: Mixing C and C++ File IO should be handled with caution. There are huge issues with combining C++ iostream (cout, cin, cerr) and printf, so, screen prints use cout, or cerr.   However, fopen is still preferred in some high speed environments since it does not invoke locale (a system call on some systems). As mentioned elsewhere, when IBM-Sharks are being used, there is a 20% penalty (or more) for using C++ File IO, and when combined with xlc (C++ compiler), there can be other issues which will destroy the integrity of any app that invokes too many File IO calls.

Note: The tiff file in the example file, is not compliant because it was the x9 records that were being validated, and the image used was created with ms-paint.

 

X9 Image Compliance Checking Program    *** Coming Soon

cBinRead.cpp  (Hides fopen,fclose, endian-ness from app).
tiffy2.cpp (old c code.).
cBinRead.hpp (interface for file IO functions.).
100_181.hpp (compliance code that checks that tags for required or optional tags). This code stands alone, so people can see where it is applied.

 

Rules for TIFF images per spec X9.100-181-2007.

Single Page Tiff only.
Little Endian format only (II is in the FileHeader)..
Single Strip. Image Length (tag-257) and Rows Per Strip (tag-278) shall have the same value. (If you must use multi-strip, then this would be "variance-2".).
Compression shall be group 4 fax.
Photometric Interpretation = 0.
XResolution and YResolution equal 200 or 240 and shall be the same.
Tag-256 (Image Width) must be non zero. Required.
Tag-257 (Image Length)must be non zero. Required.
Tag-259 (Image Compression) value must be 4 Required.
Tag-262 (Photometric Interpretation) value must be 0 Required. (A value of 1 is allowed but is "variance-1")..
Tag-273 (Strip Offsets) Required. Should only have one entry. Multistrip is allowed, under "variance-2".
Tag-278 (Rows Per Strip) Required. Multistrip is allowed, under "variance-2"
Tag-279 (Strip Byte Counts) Required. Should only have one entry. Multistrip is allowed, under "variance-2".
Tag-282 (Xresolution) must equal 200/1 or 240/1 Required. Must be same as Yresolution.
Tag-283 (Yresolution) must be same as Xresolution. Required.
Tag-254 (New Subfile Type) must equal 0. Optional.
Tag-258 (Bits Per Sample) must equal 1. Optional.
Tag-263 (Thresholding) must equal 1. Optional.
Tag-266 (Fill Order) must equal 1. Optional. (A value of 2 is allowed, but is "variance-3").
Tag-274 (Orientation) must equal 1 Optional. (A value of 3 or 4 is allowed, but is "variance-4").
Tag-277 (Samples Per Pixel) must equal 1. Optional.
Tag-293 (T6 Options) must equal 0. Optional.
Tag-296 (Resolution Unix) must equal 2. Optional.
All tags not mentioned above, are NOT permitted.

** Variance. Clearly, this code does not check that your variance is properly recorded in the X9 file, since it looks at a tiff file.

** Why should variances be avoided? This is the ugliest part of X9 files. If the X9.37 file uses one of the UCD or X9.37 standards, then field 50.17 (position 66) is the Variance Indicator. If the file is compliant with x9.100.180 (not likely), then field 50.17 (position 77) is the Variance Indicator. Oh...it gets worse...see Variance Indicator.

** Variance Indicator:I personally would use blank, as this is "undefined", and simpler then defining it. But, here are the values, if you really want to kill some time doing something nonproductive.
'0' No known variance
'1' variance for Tag 262 (Photometric Interpretation)
'2' variance for(Tag 273, Tag 278, Tag 279) (Multi-strip).
'3' variance for Tag 266 (Fill Order)
'4' variance for Tag 274 (Orientation)
'5' variances '1' and '2'
'6' variances '1' and '3'
'7' variances '1' and '4'
'8' variances '2' and '3'
'9' variances '2' and '4'
'A' variances '3' and '4'
'B' variances '1' and '2' and '3'
'C' variances '1' and '2' and '4'
'D' variances '1' and '3' and '4'
'E' variances '2' and '3' and '4'
'F' variances '1' and '2' and 3' and '4'

**Punched Card Throwback. The Variance debacle is yet another injustice we have to tolerate because the X9 format is historically based on punched cards and this relationship goes back to IBM code produced in the late 1950's.

** Open Source Tiffy.c is an old program produced by SwiftView which deserves extra credit for simplicity. Every X9 programmer should download a copy from SwiftView (free).

 

 

 

 

 

Valid XHTML 1.0 Transitional