in reply to How to resize picture in windows?
If you can get GD installed, then something like this will get you started:
#! perl -slw use strict; use GD; our $X ||= 100; our $Y ||= 100; for my $imgName ( @ARGV ) { my $img1 = GD::Image->new( $imgName ) or warn "$imgName: $!" and n +ext; my $img2 = GD::Image->new( $X, $Y, 1 ); $img2->copyResampled( $img1, 0,0, 0,0, $X,$Y, $img1->getBounds ); ( my $thumbName = $imgName ) =~ s[(\..+$)][.thumb.png]; open OUT, '>:raw', $thumbName or warn "$thumbName: $!" and next; print OUT $img2->png; close OUT; }
It resizes every image supplied on the command line to the same size (100x100 by default) and outputs them as filename.ext => filename.thumb.png.
|
|---|