Guys How can I Resize other images on fly like product images in magento??
I have c开发者_如何转开发reated a module that receives user's profile picture & I want to resize them like magento product images.
Thanks for your support.
When you resize a product image it is using a Varien_Image
behind the scenes, then it saves the image to file at the same time the URL is outputted. Since you will not be using a product image you'll need to call Varien_Image->save($destination)
yourself.
If you need to look at how it works the code is in /lib/Varien/Image.php
and /lib/Varien/Image/Adapter/Gd2.php
.
There is an excellent blog about this
http://subesh.com.np/2009/11/image-resize-magento-cache-resized-image/
精彩评论