xml log file 6.0 2.1.0 3 4 5 6 fmt/7 fmt/8 fmt/9 fmt/10 5978612 Adobe Photoshop CS3 Windows 2011:03:22 09:20:40-04:00 2011:03:11 09:18:36-05:00 a59a63c5ed7a04625840f324c22afbc4 1300800040000 true true little endian Uncompressed 1839 3239 BlackIsZero normal* in. 400 400 8 1 Adobe Photoshop CS3 Windows TIFF-hul 2011-03-22T09:20:40-04:00 5978612 TIFF 6.0 Well-Formed and valid TIFF-hul image/tiff Baseline grayscale (Class G) TIFF/IT-MP (ISO 12639:1998) DLF Benchmark for Faithful Digital Reproductions of Monographs and Serials: grayscale and white TIFFMetadata ByteOrder little-endian IFDs Number 2 IFD Offset 8 Type TIFF Entries NisoImageMetadata image/tiff little-endian 1 1 22046 3239 5956521 1 1 Backstage Library Works for NLM Nextscan Eclipse Rollfilm Adobe Photoshop CS3 Windows 2011-03-11T13:37:58 2 400 400 1839 3239 #### Perl Script #!/usr/local/bin/perl use strict; use warnings; use XML::Simple; use File::Basename; my @InputFiles = (); #my @InputFiles = ('tmp.xml'); my $xml = XML::Simple->new; foreach my $fileName (@InputFiles) { print "$fileName\n"; my ($filename, $directories, $suffix) = fileparse($fileName); my $file = $xml->XMLin($fileName) or die "Failed for $fileName: $!\n"; if ($file->{toolOutput}{xmlns}{format} ne 'TIFF') { output($filename, 'Identity Format Error'); next; } if ( not exsits $file->{toolOutput}{version} ne '6.0'){ output($filename, 'Version Error'); next; } if ( not exsits $file->{toolOutput}{status} ne 'Well-Formed and valid'){ output($filename, 'Version Error'); next; } if ( not exsits $file->{profiles}{profile} ne 'DLF Benchmark for Faithful Digital Reproductions of Monographs and Serials: grayscale and white'){ output($filename, 'Profile Error'); next; } #if ( not exsits $file->{mix:ImagingPerformanceAssessment}{mix:XSamplingFrequency} ne '400'){ # output($filename, 'X Error'); # next; # if ( not exsits $file->{mix:ImagingPerformanceAssessment}{mix:YSamplingFrequency} ne '400'){ # output($filename, 'Y Error'); # next; #} } sub output { my ($filename, $msg) = @_; my $dir = '/usr/summary/'.basename($filename).'.out'; # my $dir = 'test/'.basename($filename).'.out'; $dir =~s/(.*)_.*/$1/i; unless (-d $dir) { mkdir $dir or die "could not mkdir $dir: $!"; } my $OutputFile = "$dir/Summarylog.txt"; open(my $OUTF, ">>$OutputFile") or die "Can't open output file ($OutputFile) : $!"; print $OUTF "$filename | $msg\n"; close $OUTF; }