Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
伙计们,我如何像 magento 中的产品图像一样动态调整其他图像的大小?
我创建了一个接收用户个人资料图片的模块,我想像 magento 产品图片一样调整它们的大小。
谢谢你的支持。
当您在Varien_Image后台调整产品图像的大小时,它会在输出 URL 的同时将图像保存到文件中。由于您不会使用产品图片,因此您需要Varien_Image->save($destination)自己打电话。
Varien_Image
Varien_Image->save($destination)
如果您需要查看它是如何工作的,代码位于/lib/Varien/Image.php和/lib/Varien/Image/Adapter/Gd2.php.
/lib/Varien/Image.php
/lib/Varien/Image/Adapter/Gd2.php
有一个很棒的博客关于这个
http://subesh.com.np/2009/11/image-resize-magento-cache-resized-image/