$image = new Varien_Image('/full/fs/path/to/image.jpg');
// you cannot use method chaining with Varien_Image
$image->constrainOnly(false);
$image->keepFrame(true);
// avoid black borders by setting background colour
$image->backgroundColor(array(255,255,255));
$image->keepAspectRatio(true);
$image->resize(216, 139);
$image->save('/full/fs/path/to/save/to.jpg');
Posted by Mike Whitby to Magento (2012-02-03 11:31)