Changeset 112
- Timestamp:
- 12.12.2006 16:46:56 (2 years ago)
- Files:
-
- trunk/devel/FuzzyOcr.cf (modified) (1 diff)
- trunk/devel/FuzzyOcr.pm (modified) (3 diffs)
- trunk/devel/FuzzyOcr/Config.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/devel/FuzzyOcr.cf
r108 r112 168 168 #focr_global_timeout 1 169 169 170 # Minimum image size to scan. Images with dimensions smaller than the 171 # ones specified here will be skipped: 172 # Default: Height:4 Width:4 173 #focr_min_height 4 174 #focr_min_width 4 175 170 176 # Maximum file size for different formats in byte, bigger pictures 171 177 # will not be scanned trunk/devel/FuzzyOcr.pm
r111 r112 150 150 } 151 151 152 my $filename = $fname; $filename =~ tr{a-zA-Z0-9\.}{_}cs; 152 my $filename = $fname; $filename =~ tr{a-zA-Z0-9\-.}{_}cs; 153 debuglog("fname: \"$fname\" => \"$filename\""); 153 154 my $pdata = $p->decode(); 154 155 my $pdatalen = length($pdata); … … 235 236 236 237 #Skip images that cannot contain text 237 if ($imgfiles{$filename}{height} < 4) {238 infolog("Skipping narrow image");238 if ($imgfiles{$filename}{height} < $conf->{focr_min_height}) { 239 infolog("Skipping image: height < $conf->{focr_min_height}"); 239 240 delete $imgfiles{$filename}; 240 241 next; … … 242 243 243 244 #Skip images that cannot contain text 244 if ($imgfiles{$filename}{width} < 4) {245 infolog("Skipping flat image");245 if ($imgfiles{$filename}{width} < $conf->{focr_min_width}) { 246 infolog("Skipping image: width < $conf->{focr_min_width}"); 246 247 delete $imgfiles{$filename}; 247 248 next; trunk/devel/FuzzyOcr/Config.pm
r110 r112 195 195 setting => 'focr_threshold_'.$t, 196 196 default => 5, 197 type => $Mail::SpamAssassin::Conf::CONF_TYPE_NUMERIC 198 }); 199 } 200 foreach my $t (qw/height width/) { 201 push (@cmds, { 202 setting => 'focr_min_'.$t, 203 default => 4, 197 204 type => $Mail::SpamAssassin::Conf::CONF_TYPE_NUMERIC 198 205 });
