Views
568
Replies
1
Status
Closed
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";
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";
Related Tags
How to Improve Photoshop Performance
Learn how to optimize Photoshop for maximum speed, troubleshoot common issues, and keep your projects organized so that you can work faster than ever before!