Changeset 9

Show
Ignore:
Timestamp:
25.10.2006 16:32:36 (2 years ago)
Author:
jorge
Message:

Changed integer comparisons from 'gt' to '>'

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/devel/FuzzyOcr.pm

    r8 r9  
    379379 
    380380    my $retcode = $t->run_and_catch(sub { 
    381        @stdout_data = qx($App{gifsicle} --info $giffile); 
     381            @stdout_data = qx($App{gifsicle} --info $giffile); 
    382382    }); 
    383383 
    384384    if ($retcode) { 
    385        #FIXME: WARN HERE 
     385        #FIXME: WARN HERE 
    386386    } 
    387387 
     
    408408                                      (?: .* \b delay \s+ (\d+(?:\.\d+)?) s)? 
    409409                                      }sx; 
    410        #FIXME: Handle this error 
     410        #FIXME: Handle this error 
    411411        $n == $frameno 
    412             or warn ( "Trouble parsing 'gifsicle --info' output.
    413                      . "  Expected 'image \#$frameno', found 'image \#$n'\n" ); 
     412            or debuglog ( "Trouble parsing 'gifsicle --info' output.\n
     413                     . "  Expected 'image \#$frameno', found 'image \#$n'" ); 
    414414 
    415415        $info{'delays'}->[$frameno++] = $delay ? $delay + 0.0 : 0.0; 
     
    848848                } 
    849849            } 
    850             if ($interlaced_gif or ($image_count gt 1)) { 
     850            if ($interlaced_gif or ($image_count > 1)) { 
    851851                debuglog("Image is interlaced or animated..."); 
    852852            } 
     
    877877 
    878878            if ($corrupt) { 
    879                 if ($interlaced_gif or ($image_count gt 1)) { 
     879                if ($interlaced_gif or ($image_count > 1)) { 
    880880                    debuglog("Skipping corrupted interlaced image..."); 
    881881                    corrupt_img($Score{corrupt_unfixable}, $corrupt); 
     
    891891            } 
    892892 
    893             if ($image_count gt 1) { 
     893            if ($image_count > 1) { 
    894894                debuglog("File contains <$image_count> images, deanimating..."); 
    895                my $tfile2 = $tfile; 
    896                my $tfile3 = $tfile; 
     895                my $tfile2 = $tfile; 
     896                my $tfile3 = $tfile; 
    897897 
    898898                if ($tfile2 =~ m/\.gif$/i) { 
    899899                    $tfile2 =~ s/\.gif$/-multi.gif/i; 
    900                    $tfile3 =~ s/\.gif$/-reduced.gif/i; 
     900                    $tfile3 =~ s/\.gif$/-reduced.gif/i; 
    901901                } else { 
    902902                    $tfile2 .= ".gif"; 
    903                    $tfile3 .= "-reduced.gif"; 
    904                 } 
    905  
    906                my $info = gif_info($tfile, $t); 
    907                my $index = find_dominant_image($info); 
    908  
    909                # Pick frame number $index from the animation and spew to stdout: 
    910                if ($info->{'has_local_color_table'}) { 
    911                    # FIXME: Check retcodes 
    912                    $retcode = $t->run_and_catch(sub { 
    913                        qx($App{gifsicle} --colors=255 $tfile >$tfile3 2>>$efile); 
    914                    }); 
    915                    $retcode = $t->run_and_catch(sub { 
    916                        qx($App{gifsicle} --unoptimize $tfile3 \'#$index\' >$tfile2 2>>$efile); 
    917                    }); 
    918                } else { 
    919                    $retcode = $t->run_and_catch(sub { 
    920                        qx($App{gifsicle} --unoptimize $tfile \'#$index\' >$tfile2 2>>$efile); 
    921                    }); 
    922                
    923                $tfile = $tfile2; 
     903                    $tfile3 .= "-reduced.gif"; 
     904                } 
     905 
     906                my $info = gif_info($tfile, $t); 
     907                my $index = find_dominant_image($info); 
     908 
     909                # Pick frame number $index from the animation and spew to stdout: 
     910                if ($info->{'has_local_color_table'}) { 
     911                    # FIXME: Check retcodes 
     912                    $retcode = $t->run_and_catch(sub { 
     913                        qx($App{gifsicle} --colors=255 $tfile >$tfile3 2>>$efile); 
     914                    }); 
     915                    $retcode = $t->run_and_catch(sub { 
     916                        qx($App{gifsicle} --unoptimize $tfile3 \'#$index\' >$tfile2 2>>$efile); 
     917                    }); 
     918                } else { 
     919                    $retcode = $t->run_and_catch(sub { 
     920                        qx($App{gifsicle} --unoptimize $tfile \'#$index\' >$tfile2 2>>$efile); 
     921                    }); 
     922               
     923                $tfile = $tfile2; 
    924924            } 
    925925 
     
    11891189 
    119011901; 
     1191#vim: et ts=4 sw=4