Why not use the Image::Size module. I use it to resize the dimensions of all my graphics files in my institutions intranet. It's part of the standard Perl distribution for Win32 if you are on a Windows system.
Perl is: "The last thing to break the camel's back!".