产品图片重设插件(不会变形) - Resize images proportionally

产品图片重设插件(不会变形) - Resize images proportionally

可能是Magento系统的默认功能中在生成图片缩略图时会变形,所有有社区人员写出了个图片重设而不会变形的插件,那就不用为产品的图片费心了,这个插件是:Resize images proportionally。效果看下面的图片,最直观了:

Magento Connect:magento-community/NetAmbition_DirectResize

介绍:

Give the possibility to resize images without distorted them.

You can specify a Width and a Height value as well as a ratio.

The ratio options are :
0 - none proportionnal. The image will be resized at the Width and Height values.
1 - proportionnal, based on the Width value
2 - proportionnal, based on the Height value
3 - proportionnal for the new image can fit in the Width and the Height values.
4 - proportionnal. The new image will cover an area with the Width and the Height values.

For use, replace the actuals calls :
$this->resize(150,150);
with :
$this->directResize(150,150,3);
where the options are : (width, height, ratio)

---------------------------------------------------------------

To use the module, you must find in your .phtml file the calls of the product images and change them.

For example, in the file design/frontend/default/default/template/catalog/product/list.phtml
at line 95, you can find : "->resize(x,y)" that you must replace with "->directResize(x,y,r)" with r = ratio of your choice.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值