"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "t/31_ocropus.t" between
gscan2pdf-2.11.1.tar.xz and gscan2pdf-2.11.2.tar.xz

About: gscan2pdf is a GUI to produce PDFs from scanned documents (using Perl).

31_ocropus.t  (gscan2pdf-2.11.1.tar.xz):31_ocropus.t  (gscan2pdf-2.11.2.tar.xz)
skipping to change at line 22 skipping to change at line 22
######################### #########################
use Log::Log4perl qw(:easy); use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init($WARN); Log::Log4perl->easy_init($WARN);
my $logger = Log::Log4perl::get_logger; my $logger = Log::Log4perl::get_logger;
SKIP: { SKIP: {
skip 'Ocropus not installed', 7 unless Gscan2pdf::Ocropus->setup($logger); skip 'Ocropus not installed', 7 unless Gscan2pdf::Ocropus->setup($logger);
# Create test image # Create test image
system( qw(convert +matte -depth 1 -pointsize 12 -density 300), system( qw(convert +matte -depth 1), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
'label:The quick brown fox', 'test.png' ); 'label:The quick brown fox', 'test.png' );
my $got = Gscan2pdf::Ocropus->hocr( my $got = Gscan2pdf::Ocropus->hocr(
file => 'test.png', file => 'test.png',
language => 'eng', language => 'eng',
language => $logger, language => $logger,
threshold => 95 threshold => 95
); );
like( $got, qr/The quick brown fox/, 'Ocropus returned sensible text' ); like( $got, qr/The quick brown fox/, 'Ocropus returned sensible text' );
# Create colour test image # Create colour test image
system( qw(convert -fill lightblue -pointsize 12 -density 300), system( qw(convert -fill lightblue), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
'label:The quick brown fox', 'test.png' ); 'label:The quick brown fox', 'test.png' );
$got = Gscan2pdf::Ocropus->hocr( $got = Gscan2pdf::Ocropus->hocr(
file => 'test.png', file => 'test.png',
language => 'eng', language => 'eng',
logger => $logger, logger => $logger,
threshold => 95 threshold => 95
); );
like( like(
$got, $got,
skipping to change at line 56 skipping to change at line 56
'Ocropus returned sensible text after thresholding' 'Ocropus returned sensible text after thresholding'
); );
skip 'Tesseract not installed', 5 skip 'Tesseract not installed', 5
unless Gscan2pdf::Tesseract->setup($logger); unless Gscan2pdf::Tesseract->setup($logger);
my $languages = Gscan2pdf::Tesseract->languages; my $languages = Gscan2pdf::Tesseract->languages;
skip 'German language pack for Tesseract not installed', 5 skip 'German language pack for Tesseract not installed', 5
unless ( defined $languages->{'deu'} ); unless ( defined $languages->{'deu'} );
# Create test image # Create test image
system( qw(convert +matte -depth 1 -pointsize 12 -density 300), system( qw(convert +matte -depth 1), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
"label:'öÖäÄüÜß'", 'test.png' ); "label:'öÖäÄüÜß'", 'test.png' );
$got = Gscan2pdf::Ocropus->hocr( $got = Gscan2pdf::Ocropus->hocr(
file => 'test.png', file => 'test.png',
language => 'deu', language => 'deu',
logger => $logger logger => $logger
); );
is( Encode::is_utf8( $got, 1 ), 1, "Ocropus returned UTF8" ); is( Encode::is_utf8( $got, 1 ), 1, "Ocropus returned UTF8" );
for my $c (qw( ö ä ü ß )) { for my $c (qw( ö ä ü ß )) {
my $c2 = decode_utf8($c); my $c2 = decode_utf8($c);
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)