Skip Menu |

This queue is for tickets about the OCR-PerfectCR CPAN distribution.

Report information
The Basics
Id: 59410
Status: new
Priority: 0/
Queue: OCR-PerfectCR

People
Owner: Nobody in particular
Requestors: zarkxe [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.03
Fixed in: 0.03



Subject: Illegal division by zero
my problem is : --------------- $ ./ocr.pl Background color at index 0 [0 0 0] Finding bounds starting at 0 Character at (15, 102)-(21, 111) Illegal division by zero at /usr/local/share/perl/5.10.1/OCR/PerfectCR.pm line 250. my solution is : --------------- I edit file /usr/local/share/perl/5.10.1/OCR/PerfectCR.pm I replace : my $avgcolor = sprintf("%.0f", $totalcolor/$totalweight); $avgcolor = undef if $totalweight < 1; by : my $avgcolor = 0; if ($totalweight != 0) { $avgcolor = sprintf("%.0f", $totalcolor/$totalweight); $avgcolor = undef if $totalweight < 1; } else { $avgcolor = sprintf("%.0f",0); $avgcolor = undef if $totalweight < 1; } my script is : --------------- #!/usr/bin/perl -w use OCR::PerfectCR; use GD; my $recognizer = OCR::PerfectCR->new; $recognizer->load_charmap_file("charmap"); my $image = GD::Image->new("image.png") or die "Can't open example.png: $!"; my $string = $recognizer->recognize($image); $recognizer->save_charmap_file("charmap"); my version is : --------------- cpan[2]> install OCR::PerfectCR OCR::PerfectCR is up to date (0.03).
Subject: image.png
Download image.png
image/png 351b
image.png