开发者

How to resize images other than product images in magento

开发者 https://www.devze.com 2023-02-28 19:01 出处:网络
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 prod

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/

0

精彩评论

暂无评论...
验证码 换一张
取 消