in reply to Re: file i/o beyond my knowledge
in thread file i/o beyond my knowledge

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

Replies are listed 'Best First'.
Re: Re: Re: file i/o beyond my knowledge
by firstbaseman83 (Initiate) on Jan 15, 2003 at 02:50 UTC
    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