DigitalKitty has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use GD; my $order_of_mag; print "Enter order of magnitude for new picture: "; chomp( $order_of_mag = <STDIN> ); my $pic = GD::Image->newFromPng( "pc.png" ); my @size = $pic->getBounds(); my @newSize = map( { $_ * $order_of_mag } @size ); my $newPic = new GD::Image ( @newSize ); $newPic->copyResized( $pic, 0, 0, 0, 0, @newSize, @size ); open FH, ">pc2.png" || die "Could not write to file: $!\n"; binmode FH; print FH $newPic->png(); close FH or die "Could not close file: $!\n"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Resizing an image with perl.
by io (Scribe) on Aug 12, 2002 at 16:33 UTC | |
|
Re: Resizing an image with perl.
by seattlejohn (Deacon) on Aug 12, 2002 at 17:29 UTC | |
|
Re: Resizing an image with perl.
by hossman (Prior) on Aug 13, 2002 at 00:59 UTC | |
by xtype (Deacon) on Aug 15, 2002 at 08:29 UTC |