"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "t/411_tesseract.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).

411_tesseract.t  (gscan2pdf-2.11.1.tar.xz):411_tesseract.t  (gscan2pdf-2.11.2.tar.xz)
skipping to change at line 25 skipping to change at line 25
SKIP: { SKIP: {
skip 'Tesseract not installed', 15 skip 'Tesseract not installed', 15
unless Gscan2pdf::Tesseract->setup($logger); unless Gscan2pdf::Tesseract->setup($logger);
is Gscan2pdf::Tesseract::_iso639_1to3('en'), 'eng', "_iso639_1to3 en"; is Gscan2pdf::Tesseract::_iso639_1to3('en'), 'eng', "_iso639_1to3 en";
is Gscan2pdf::Tesseract::_iso639_1to3('C'), 'eng', "_iso639_1to3 C"; is Gscan2pdf::Tesseract::_iso639_1to3('C'), 'eng', "_iso639_1to3 C";
# Create b&w test image # Create b&w test image
system( system(
qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -density 300), qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
'label:The quick brown fox', 'label:The quick brown fox',
'test.png' 'test.png'
); );
my ( $got, $messages ) = Gscan2pdf::Tesseract->hocr( my ( $got, $messages ) = Gscan2pdf::Tesseract->hocr(
file => 'test.png', file => 'test.png',
language => 'eng', language => 'eng',
logger => $logger, logger => $logger,
dpi => 300, dpi => 300,
); );
like( $got, qr/T[hn]e/, 'Tesseract returned "The"' ); like( $got, qr/T[hn]e/, 'Tesseract returned "The"' );
like( $got, qr/quick/, 'Tesseract returned "quick"' ); like( $got, qr/quick/, 'Tesseract returned "quick"' );
like( $got, qr/brown/, 'Tesseract returned "brown"' ); like( $got, qr/brown/, 'Tesseract returned "brown"' );
like( $got, qr/f(o|0)x/, 'Tesseract returned "fox"' ); like( $got, qr/f(o|0)x/, 'Tesseract returned "fox"' );
# 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, $messages ) = Gscan2pdf::Tesseract->hocr( ( $got, $messages ) = Gscan2pdf::Tesseract->hocr(
file => 'test.png', file => 'test.png',
language => 'eng', language => 'eng',
logger => $logger, logger => $logger,
threshold => 95, threshold => 95,
dpi => 300, dpi => 300,
); );
skipping to change at line 65 skipping to change at line 65
like( $got, qr/quick/, 'After thresholding, Tesseract returned "quick"' ); like( $got, qr/quick/, 'After thresholding, Tesseract returned "quick"' );
like( $got, qr/brown/, 'After thresholding, Tesseract returned "brown"' ); like( $got, qr/brown/, 'After thresholding, Tesseract returned "brown"' );
like( $got, qr/f(o|0)x/, 'After thresholding, Tesseract returned "fox"' ); like( $got, qr/f(o|0)x/, 'After thresholding, Tesseract returned "fox"' );
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 b&w test image # Create b&w test image
system( system(
qw(convert +matte -depth 1 -colorspace Gray -pointsize 12 -density 300), qw(convert +matte -depth 1 -colorspace Gray), '-family', 'DejaVu Sans', qw(-pointsize 12 -density 300),
"label:'süß tränenüberströmt'", "label:'süß tränenüberströmt'",
'test.png' 'test.png'
); );
( $got, $messages ) = Gscan2pdf::Tesseract->hocr( ( $got, $messages ) = Gscan2pdf::Tesseract->hocr(
file => 'test.png', file => 'test.png',
language => 'deu', language => 'deu',
logger => $logger, logger => $logger,
dpi => 300, dpi => 300,
); );
 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)