Click here to get back home

Win32 OLE PS - Resize image

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Win32 OLE PS - Resize image Slickuser 12-24-2007
Posted by Slickuser on December 24, 2007, 4:00 am
Please log in for more thread options
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-> = 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";

Similar ThreadsPosted
Dave Roth's site (Win32::AdminMisc, Win32::ODBC, etc.) not available. December 22, 2005, 8:46 am
Problems installing Win32-Setupsup, Win32-CtrlGUI October 10, 2004, 12:31 am
[RFC] GD-Image-CopyIFS May 14, 2005, 3:42 pm
image magick through apt-get November 27, 2004, 5:48 pm
image::grab January 4, 2005, 7:22 pm
[RFC] Image::Pngslimmer December 24, 2006, 3:34 pm
Image magick palette July 30, 2004, 9:16 pm
Image::Magick newbie September 5, 2005, 10:19 pm
Image data parsing October 27, 2004, 3:36 pm
Image Magick code help November 29, 2004, 12:14 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap