I am using this code to store particular product image size in my own different folder. but it is storing all the size images in "p1" folder.my image width is 500 and height could be any should be store in p1/c/ . another is width with 280 and height any should be save in p2/c/.
any solution for this?
if(($this->_width == 500) || (!empty($this->_height)))
{
$path = array(
// Mage::getSingleton('catalog/product_media_config')->getBaseMediaPath(),
Mage::getSingleton('catalog/product_media_config'),
// 'cache',
// Mage::app()->getStore()->getId(),
$path[] = 'p1/C:' // $this->getDestinationSubdir()
);
}
elseif(($this->_width == 280) || (!empty($this->_height)))
{
$path = array(
// Mage::getSingleton('catalog/product_media_config')->getBaseMediaPath(),
Mage::getSingleton('catalog/product_media_config'),
// 'cache',
// Mage::app()->getStore()->getId(),
$path[] = 'p2/C:' // $this->getDestinationSubdir()
);
}
else
{
$path = array(
// Mage::getSingleton('catalog/product_media_config')->getBaseMediaPath(),
Mage::getSingleton('catalog/product_media_config'),
// 'cache',
// Mage::app()->getStore()->getId(),
$path[] = 'R/C:' // $this->getDestinationSubdir()
);
}