SVN: toys/rsget.pl: README RSGet/CaptchaImage.pm

sparky sparky at pld-linux.org
Tue Dec 8 03:21:32 CET 2009


Author: sparky
Date: Tue Dec  8 03:21:31 2009
New Revision: 11019

Modified:
   toys/rsget.pl/README
   toys/rsget.pl/RSGet/CaptchaImage.pm
Log:
- warn about tesseract problems


Modified: toys/rsget.pl/README
==============================================================================
--- toys/rsget.pl/README	(original)
+++ toys/rsget.pl/README	Tue Dec  8 03:21:31 2009
@@ -10,6 +10,7 @@
 - Fix freezing http server - move to separate thread/process ?
 - Fix bugs in http server, and speed it up.
 - Better file writing methods, to allow downloading from multiple sources.
+- Backoff if captcha fails to many times.
 
 Planned features:
 - Multiuser support (may require major changes in the code).

Modified: toys/rsget.pl/RSGet/CaptchaImage.pm
==============================================================================
--- toys/rsget.pl/RSGet/CaptchaImage.pm	(original)
+++ toys/rsget.pl/RSGet/CaptchaImage.pm	Tue Dec  8 03:21:31 2009
@@ -267,7 +267,12 @@
 	unlink $bmp, $txt;
 	$self->write_bmp( $bmp );
 	
-	system "tesseract $bmp $file 2>/dev/null";
+	my $tes = `tesseract $bmp $file 2>&1`;
+	chomp $tes;
+	if ( $tes ne "Tesseract Open Source OCR Engine" ) {
+		warn "tesseract failed; check your instalation!\n";
+		warn "tesseract: $tes" if $tes;
+	}
 	
 	my $text;
 	if ( open my $f_in, "<", $txt ) {


More information about the pld-cvs-commit mailing list