Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: file i/o beyond my knowledge

by fredopalus (Friar)
on Jan 14, 2003 at 04:09 UTC ( [id://226715]=note: print w/replies, xml ) Need Help??


in reply to file i/o beyond my knowledge

It would have probably been a good idea if you had shown some effort and showed us your attempt to accomplish this. Also, you should give us some info about the system you're working on.


Here's some documentation:
Next time follow these steps:
  1. Read Documentation
  2. Ask Question

Replies are listed 'Best First'.
Re: Re: file i/o beyond my knowledge
by firstbaseman83 (Initiate) on Jan 15, 2003 at 02:45 UTC
    My apologies..
    I'm using Windows 2000, ActiveState Perl version 5.6.1 if you
    need to know that too.

    Here is my current coding:

    #!/usr/bin/perl # Import Modules # use File::Copy; use Image::Magick; use File::Find; # Prompt for Directory # print "Enter Directory: "; chomp($dir = <STDIN>); # Find Images # find(\&mogrify, $dir); # Resize Images # # Write to thumbnails directory # # With same filename extension # sub mogrify { $img = Image::Magick->new; $img->Read($_); # Test for Extensions # if ($_ =~ /\.(\w+)$/) { $ext2 = $1; } my $ext = $ext2; $img->Resize('geometry' => "120x120", 'filter' => "Cubic"); $img->Write("$_"."-thumb"."\.$ext2"); } # Make the directory of thumbnails # system("mkdir thumbnails"); # Move all thumbnails to the thumbnails directory # system("move *thumb*.*, thumbnails");

    Sorry if the indentation's bad....

    Is any of this the correct way to do it?

    Thanks,
    ~firstbaseman83
      and In reply to freopalus,
      I read the documentation for eveything
      I could think of but I couldn't find my exact
      answer.
      ~firstbaseman83
        I guess I should have told my problem in the previous post.
        This script works alright, it will resize the images
        create a thumbnails directory
        and move all the image with a -thumb extension into
        the thumbnails directory.

        However, that only happens when I specify the directory that the script is currently in.
        I am guessing that my problem lies in the
        $img->Read($_);
        coding.

        Is there any way to get around this?
        Any help is appreciated.

        ~firstbaseman83

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://226715]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-20 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found