在Magento中调整图像大小
我有一个图像叫做:在Magento中调整图像大小,magento,Magento,我有一个图像叫做: Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages()->getItemByColumnValue('position','2') 这是第二张图像(按排序) 需要能够使用Magento的resize(),我可以用任何方法吗?未测试,但请尝试 $_image = Mage::getModel('catalog/product')->l
Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages()->getItemByColumnValue('position','2')
这是第二张图像(按排序)
需要能够使用Magento的resize(),我可以用任何方法吗?未测试,但请尝试
$_image = Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages()->getItemByColumnValue('position','2');
echo $this->helper('catalog/image')->init($_product, 'thumbnail', $_image->getFile())->resize(30, 30);
/app/code/core/Mage/Catalog/Helper/Image.php
public function init(Mage_Catalog_Model_Product $product, $attributeName, $imageFile=null)
请参见它没有设置为缩略图或其他任何内容,它还能工作吗?