S
surf
I'm using activestate perl 5.8.6
My program below tries to shrink a jpeg file.
The original file is 850 k, and the resulting file is 27 bytes. It's
not working obviously.
I have tried various different ways of creating the img_data via new()
before the
CopyResampled() call.
===========================================
#!/bin/perl
use GD;
my $img = GD::Image->new("JE6001_1.JPG");
($w,$h) = $img->getBounds;
print("$w x $h\n");
$dw = int($w * 0.75);
$dh = int($h * 0.75);
print("$dw x $dh\n");
$img_data = new GD::Image($w,$h);
$img_data->copyResampled($img,0,0,0,0,$dw,$dh,$w,$h);
open(FL, ">x.jpg");
binmode FL;
print FL $img_data;
My program below tries to shrink a jpeg file.
The original file is 850 k, and the resulting file is 27 bytes. It's
not working obviously.
I have tried various different ways of creating the img_data via new()
before the
CopyResampled() call.
===========================================
#!/bin/perl
use GD;
my $img = GD::Image->new("JE6001_1.JPG");
($w,$h) = $img->getBounds;
print("$w x $h\n");
$dw = int($w * 0.75);
$dh = int($h * 0.75);
print("$dw x $dh\n");
$img_data = new GD::Image($w,$h);
$img_data->copyResampled($img,0,0,0,0,$dw,$dh,$w,$h);
open(FL, ">x.jpg");
binmode FL;
print FL $img_data;