Win32 OLE PS - Resize image

Win32 OLE PS - Resize image

am 24.12.2007 10:00:11 von Slickuser

Hi all,

I don't know what is the format to resize the image from Perl PS OLE.
Here is the API, Sub ResizeImage([Width], [Height], [Resolution],
[ResampleMethod])
change the size of the image.

I try put as numbers and 800px for my width in a String and it doesn't
work either.
Any help?
Other method work.

use Win32::OLE;
use OLE;
use Cwd;

my $Photoshop = Win32::OLE->new('Photoshop.Application')
or die "Can't start Photoshop!\n";
$Photoshop->{'Visible'} = 0;

my $cwd = getcwd();
$sourceImageFileName = $cwd."/800.jpg";

my $Document = $Photoshop->Open($sourceImageFileName)
or die "Can't open $sourceImageFileName.\n";

my $width = "800 pixels";
my $height = "600 pixels";
my $resolution = "96 pixels/inch";
my $resample_method = "Bicubic";
my $rotate = 0;

$Document->ResizeImage($width,$height,$resolution,$resample_ method);
#$Document->SaveAs("C:/test.jpg");

if ($rotate) {
$Document->RotateCanvas(-90.0);
}

$Document->Save();
$Document->Close;

print "Width: $width, Height: $height\n";