I don't know much about the problem you are asking for.
But it seems to me that you're wrong when calling the subroutine wanted.

 # File::Find wanted function
 sub wanted;

It must be:

 # File::Find wanted function
&wanted;

Shouldn't it???
-rm-




----- Original Message ----- 
From: Shawn Wilson <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 27, 2003 11:06 AM
Subject: image property testing... take II


> ok, i have cleaned up the code, and fixed all of the mistakes that i can 
> find, but i still can't get this tying to compile and run. and, my code 
> surely isn't written stout enough to handle a 'use strict'. if someone 
> could tell me what i am STILL doing wrong i'd appreciate it. The Code:
> 
> #!/usr/bin/perl
> 
> use warnings;
> # use strict;
> use File::Find;
> use File::Remove qw(remove);
> use Image::Info qw(image_info);
> use File::Scan;
> 
> # File::Find wanted function
> sub wanted;
> 
> # variables
> our ( $file, $dir );
> *file = *File::Find::name;
> *dir = *File::Find::dir;
> 
> 
> print "Where are the pictures/?";
> chomp( my $indir = <STDIN> );
> 
> File::Find::find(\&wanted, '$indir');
> exit;
> 
> sub wanted {
> unless ($file =~ /\.jpg\z/ or
> $file =~ /\.tif\z/ or
> $file =~ /\.bmp\z/ or
> $file =~ /\.png\z/ ) { # delete every file exept listed image types.
> remove $file;
> }
> else {
> my $info = image_info(\$file); # the attributes of the image file
> $type = $info->(file_ext); # three letter image type
> $w = $info->(width); # pixel width
> $h = $info->(height); # pixel height
> $color = $info->(color_type) # color type
> # delete small images
> if( ($w < 200 and $h < 400) or ($w < 400 and $h < 200) ) {
> remove $file;
> }
> # delete images that try to be a different type from what they say
> if ($type ne 'bmp' or
> $type ne 'jpg' or
> $type ne 'png' or
> $type ne 'tif') {
> remove $file;
> }
> # delete all gray scale images
> if ($color ne 'Gray' or
> $color ne'GrayA') {
> remove $file;
> }
> # check images for viruses
> if ($scanres->scan(\$file) ) {
> if( $scanres->suspicious) {
> print "$file looks like it has a virus, delete/? /(Y//N/)";
> remove $file if <STDIN> =~ /y|Y/;
> }
> }
> }
> }
> 
> 
> 
> ..... and the errors:
> 
> Unquoted string "width" may clash with future reserved word at 
> ./bigimg2.pl line 35.
> Unquoted string "height" may clash with future reserved word at 
> ./bigimg2.pl line 36.
> syntax error at ./bigimg2.pl line 39, near ") {"
> syntax error at ./bigimg2.pl line 62, near "}"
> Execution of ./bigimg2.pl aborted due to compilation errors.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to