Changeset 59
- Timestamp:
- 26.11.2006 18:49:57 (2 years ago)
- Files:
-
- trunk/devel/FuzzyOcr.pm (modified) (9 diffs)
- trunk/devel/FuzzyOcr/Deanimate.pm (modified) (3 diffs)
- trunk/devel/FuzzyOcr/Hashing.pm (modified) (1 diff)
- trunk/devel/FuzzyOcr/Misc.pm (modified) (3 diffs)
- trunk/devel/FuzzyOcr/Preprocessor.pm (added)
- trunk/devel/FuzzyOcr/Scanset.pm (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/devel/FuzzyOcr.pm
r58 r59 312 312 my ($retcode, @stdout_data) = save_execute( 313 313 "$conf->{focr_bin_giftext} $file", 314 undef, 314 315 ">$imgdir/giftext.info", 315 316 ">>$imgdir/giftext.err", 1); … … 338 339 $tfile .= "-fixed.gif"; 339 340 printf RAWERR "## $conf->{focr_bin_giffix} $file >$tfile 2>>$efile\n" if ($haserr>0); 340 $retcode = save_execute("$conf->{focr_bin_giffix} $file", ">$tfile", ">>$efile"); 341 342 $retcode = save_execute("$conf->{focr_bin_giffix} $file", undef, ">$tfile", ">>$efile"); 341 343 342 344 if ($retcode<0) { # only care if we timed out … … 388 390 } 389 391 printf RAWERR qq(## $conf->{focr_bin_gifinter} $cfile >$tfile 2>>$efile\n) if ($haserr>0); 390 $retcode = save_execute("$conf->{focr_bin_gifinter} $cfile", ">$tfile", ">>$efile"); 392 393 $retcode = save_execute("$conf->{focr_bin_gifinter} $cfile", undef, ">$tfile", ">>$efile"); 391 394 392 395 if ($retcode<0) { … … 404 407 405 408 printf RAWERR qq(## $conf->{focr_bin_giftopnm} $tfile >$pfile 2>>$efile\n) if ($haserr>0); 406 $retcode = save_execute("$conf->{focr_bin_giftopnm} $tfile", ">$pfile", ">>$efile"); 409 410 $retcode = save_execute("$conf->{focr_bin_giftopnm} $tfile", undef, ">$pfile", ">>$efile"); 407 411 408 412 if ($retcode<0) { … … 439 443 } 440 444 printf RAWERR qq(## $conf->{focr_bin_jpegtopnm} $file >$pfile 2>>$efile\n) if ($haserr>0); 441 my $retcode = save_execute("$conf->{focr_bin_jpegtopnm} $file", ">$pfile", ">>$efile");445 my $retcode = save_execute("$conf->{focr_bin_jpegtopnm} $file", undef, ">$pfile", ">>$efile"); 442 446 443 447 if ($retcode<0) { … … 474 478 475 479 printf RAWERR qq(## $conf->{focr_bin_pngtopnm} $file >$pfile 2>>$efile\n) if ($haserr>0); 476 my $retcode = save_execute("$conf->{focr_bin_pngtopnm} $file", ">$pfile", ">>$efile");480 my $retcode = save_execute("$conf->{focr_bin_pngtopnm} $file", undef, ">$pfile", ">>$efile"); 477 481 478 482 if ($retcode<0) { … … 509 513 printf RAWERR qq(## $conf->{focr_bin_bmptopnm} $file >$pfile 2>>$efile\n) if ($haserr>0); 510 514 511 my $retcode = save_execute("$conf->{focr_bin_bmptopnm} $file", ">$pfile", ">>$efile");515 my $retcode = save_execute("$conf->{focr_bin_bmptopnm} $file", undef, ">$pfile", ">>$efile"); 512 516 if ($retcode<0) { 513 517 chomp $retcode; … … 543 547 } 544 548 printf RAWERR qq(## $conf->{focr_bin_tifftopnm} $file >$pfile 2>>$efile\n) if ($haserr>0); 545 my $retcode = save_execute("$conf->{focr_bin_tifftopnm} $file", ">$pfile", ">>$efile");549 my $retcode = save_execute("$conf->{focr_bin_tifftopnm} $file", undef, ">$pfile", ">>$efile"); 546 550 547 551 if ($retcode<0) { … … 607 611 printf RAWERR qq(## $scan 2>>$efile\n) if ($haserr>0); 608 612 609 my ($retcode, @ocrdata) = save_execute("$scan", ">$imgdir/ocr.temp", ">>$efile",1);613 my ($retcode, @ocrdata) = save_execute("$scan", undef, ">$imgdir/ocr.temp", ">>$efile",1); 610 614 if ($retcode<0) { 611 615 debuglog("Timeout: \"$scanset\" took more than $conf->{focr_timeout} sec."); trunk/devel/FuzzyOcr/Deanimate.pm
r57 r59 35 35 my $retcode = save_execute( 36 36 "$conf->{focr_bin_gifsicle} --colors=255 $tfile", 37 undef, 37 38 ">$tfile3", 38 39 ">>$efile"); … … 47 48 my $retcode = save_execute( 48 49 "$conf->{focr_bin_gifsicle} --unoptimize $tfile \'#$index\'", 50 undef, 49 51 ">$tfile2", 50 52 ">>$efile"); … … 75 77 ($retcode, @stdout_data) = save_execute( 76 78 "$conf->{focr_bin_gifsicle} --info $giffile", 79 undef, 77 80 ">$imgdir/gifsicle.info", 78 81 ">>$imgdir/gifsicle.err", 1); trunk/devel/FuzzyOcr/Hashing.pm
r58 r59 334 334 my ($r, @stdout_data) = save_execute( 335 335 "$conf->{focr_bin_ppmhist} -noheader $pfile", 336 undef, 336 337 ">$imgdir/ppmhist.info", 337 338 ">/dev/null", 1); trunk/devel/FuzzyOcr/Misc.pm
r58 r59 42 42 my $conf = get_config(); 43 43 my $t = get_timeout(); 44 my ($cmd, $std out, $stderr, $return_stdout) = @_;44 my ($cmd, $stdin, $stdout, $stderr, $return_stdout) = @_; 45 45 my ($pgm,undef) = split(' ',$cmd,2); 46 46 $stdout = '>/dev/null' unless $stdout; … … 55 55 } elsif (not $pid) { 56 56 debuglog("Exec: $cmd $stdout $stderr",2); 57 open(STDOUT, $stdout); 58 open(STDERR, $stderr); 57 if (defined $stdin) { 58 open(STDIN, $stdin); 59 } 60 if (defined $stdout) { 61 open(STDOUT, $stdout); 62 } 63 if (defined $stderr) { 64 open(STDERR, $stderr); 65 } 59 66 exec($cmd); 60 67 exit($?); … … 86 93 } elsif (not $pid) { 87 94 debuglog("Exec: $cmd $stdout $stderr",2); 88 open(STDOUT, $stdout); 89 open(STDERR, $stderr); 95 96 if (defined $stdin) { 97 open(STDIN, $stdin); 98 } 99 if (defined $stdout) { 100 open(STDOUT, $stdout); 101 } 102 if (defined $stderr) { 103 open(STDERR, $stderr); 104 } 90 105 exec($cmd); 91 106 exit($?);
