Changeset 126 for trunk/devel

Show
Ignore:
Timestamp:
08.01.2007 01:01:47 (4 years ago)
Author:
decoder
Message:

Added focr_max_height/width

Fixed bug with stripped spaces matching vs. non stripped spaces matching counting words twice

Location:
trunk/devel
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/devel/FuzzyOcr.cf

    r118 r126  
    179179# ones specified here will be skipped: 
    180180# Default: Height:4 Width:4 
     181# 
    181182#focr_min_height 4 
    182183#focr_min_width 4 
     184 
     185# Maximum image size to scan. Images with dimensions bigger than the 
     186# ones specified here will be skipped: 
     187# Default: Height:800 Width:800 
     188# 
     189#focr_max_height 800 
     190#focr_max_width 800 
     191 
    183192 
    184193# Maximum file size for different formats in byte, bigger pictures  
  • trunk/devel/FuzzyOcr.pm

    r123 r126  
    249249        } 
    250250 
     251        #Skip too big images, screenshots etc 
     252        if ($imgfiles{$filename}{height} > $conf->{focr_max_height}) { 
     253            infolog("Skipping image: height > $conf->{focr_max_height}"); 
     254            delete $imgfiles{$filename}; 
     255            next; 
     256        } 
     257 
     258        #Skip too big images, screenshots etc 
     259        if ($imgfiles{$filename}{width} > $conf->{focr_max_width}) { 
     260            infolog("Skipping image: width > $conf->{focr_max_width}"); 
     261            delete $imgfiles{$filename}; 
     262            next; 
     263        } 
     264 
    251265        #Found Image!! Get a temporary dir to save image 
    252266        $imgdir = Mail::SpamAssassin::Util::secure_tmpdir(); 
     
    782796            debuglog("ocrdata=>>".join("",@result)."<<=end"); 
    783797            foreach $modus (0 .. 1) { 
     798                $cmcnt = 0; 
     799                @cfound = (); 
    784800                foreach my $ww (keys %words) { 
    785801                    my $w = lc $ww; 
  • trunk/devel/FuzzyOcr/Config.pm

    r124 r126  
    204204            setting => 'focr_min_'.$t, 
    205205            default => 4, 
     206            type => $Mail::SpamAssassin::Conf::CONF_TYPE_NUMERIC 
     207        }); 
     208        push (@cmds, { 
     209            setting => 'focr_max_'.$t, 
     210            default => 800, 
    206211            type => $Mail::SpamAssassin::Conf::CONF_TYPE_NUMERIC 
    207212        });