How to deal with image quality in magento? [closed]

我们两清 提交于 2019-12-03 10:11:16

A method called setQuality has been implemented and can be used directly in templates.

For example:

echo $this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile())->resize(42, 50)->setQuality(95);

I've found this tutorial around Google. New method called setQuality has been implemented since Magento CE 1.4 and can be used directly in template files. For example if you want to improve the quality of product images in category view, open app/design/frontend/yourpackage/yourtheme/template/catalog/product/list.phtml and add ->setQuality(100) in the end of img src as follows:

<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(122,180)->setQuality(100); ?>" alt="" />

Now we have good quality images in the product list. Hope this helps

vaas

magento 1.7 http://www.magentopowered.com/increase-product-images-quality-on-magento/ check this. While uploading product images, magento compress images. find:

$functionParameters = array();
$functionParameters[] = $this->_imageHandler;
$functionParameters[] = $fileName;

add below line:

$functionParameters[] = 100;

find:

if (!is_null($this->quality()) && $this->_fileType == IMAGETYPE_JPEG)

comment:

// $functionParameters[] = $this->quality();

You can install the free magento extension Mediarocks_RetinaImages and set the quality via configuration. You don't need to enable the retina images if you don't need to.

There is a setting in the backend, in System->Catalog->Image CDN where you can choose the image Compression Rate : from 1 to 9 ... easy, but it had to find !

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!