How to work Cache of media/catalog/product/cache in Magento

匿名 (未验证) 提交于 2019-12-03 09:02:45

问题:

media\catalog\product\cache    \1\small_image\120x120\9df78dab3d52sd08dse5fw8d27w36e95        a\       b\       d\       ... 

回答1:

If you wish to know more about that hash key, I believe it is created in the Mage_Catalog_Model_Product_Image class, at the bottom of the setBaseFile function, it basically takes properties of the image, implodes them together and creates a hash.

    // add misk params as a hash     $miscParams = array(             ($this->_keepAspectRatio  ? '' : 'non') . 'proportional',             ($this->_keepFrame        ? '' : 'no')  . 'frame',             ($this->_keepTransparency ? '' : 'no')  . 'transparency',             ($this->_constrainOnly ? 'do' : 'not')  . 'constrainonly',             $this->_rgbToString($this->_backgroundColor),             'angle' . $this->_angle,             'quality' . $this->_quality     );      // if has watermark add watermark params to hash     if ($this->getWatermarkFile()) {         $miscParams[] = $this->getWatermarkFile();         $miscParams[] = $this->getWatermarkImageOpacity();         $miscParams[] = $this->getWatermarkPosition();         $miscParams[] = $this->getWatermarkWidth();         $miscParams[] = $this->getWatermarkHeigth();     } 

If you need to generate the hash yourself you can use the same steps. Obviously HASH'ing is a one way process, so it is impossible to take the value and find out the image properties.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!