如何在Magento中处理媒体/目录/产品/缓存的缓存 [英] How to work Cache of media/catalog/product/cache in Magento
问题描述
我想知道如何处理媒体/目录/产品/缓存的缓存我不知道如何制作目录结构。
我的例子是
i want to know how to work the cache of media/catalog/product/cache i don´t know how made the directory structure. My example is
media\catalog\product\cache
\1\small_image\120x120\9df78dab3d52sd08dse5fw8d27w36e95
a\
b\
d\
...
我不明白如何取缓存中的数字1 \\ $
接下来如何取哈希密钥9df78dab3d52sd08dse5fw8d27w36e95
而且很多次代替higthxweith(目录)取numberx(目录)
我需要知道所有因为我想制作一个外部CDN并解放来调整我机器中的图像大小。
Thx
i don´t understand how to take the number 1 in cache\ next how to take the hash key 9df78dab3d52sd08dse5fw8d27w36e95 and many times in stead of higthxweith(directory) take numberx(directory) I need to know all because i want to made a external CDN and liberate to resize images in my machine. Thx
推荐答案
如果您想了解更多有关该哈希键的信息,我相信它是在Mage_Catalog_Model_Product_Image类中创建的,在setBaseFile函数的底部,它基本上获取图像的属性,将它们一起内爆并创建一个哈希。
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();
}
如果您需要自己生成哈希,可以使用相同的步骤。显然,HASH'ing是一个单向过程,因此不可能获取值并找出图像属性。
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.
这篇关于如何在Magento中处理媒体/目录/产品/缓存的缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!