Resize image in magento <?php /*Existing Image Path*/ $currentimagePath = Mage::getBaseDir('media') . DS . 'alice_banner'. DS . $value->getFilename(); /*Resized Image Path*/ $rszImagePath = Mage::getBaseDir('media') . DS . 'alice_banner'. DS . 'cache' . DS .'1160x525' .DS. $value->getFilename(); if (!file_exists($rszImagePath)) { $image = new Varien_Image($currentimagePath); $image->resize(1160, 525); $image->save($rszImagePath); } ?> /*Final Image*/ <img src="<?php echo Mage::getBaseUrl('media') . DS . 'alice_banner'. DS . 'cache' . DS .'1160x525' .DS. $value->getFilename(); ?>"/>
Varien_Image is not working in pthml file. I called one pthml file on Home page CMS and when I used this Varien_Image then home page content are not showking.
Please suggest on this.