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

风格不统一 提交于 2019-12-21 03:01:46

问题


I've noticed that on my website Many of the images are overoptimized and have artifacting (blurry edges). They look really bad.

So i've been looking into what how magento (1.6) handles those conversions but I don't know id it does.

So you can give a look here to get an idea: HERE

It depends on your monitor. Mine is good (bad) in the sense that these things stand out pretty clearly. Other monitors are more forgiving. So I'm looking to figure out how to do a higher quality compression ratio without sacrificing too much bandwidth with big files.

Is that possible ? Its hosted on Amazon Web Services.

Thanks


回答1:


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);




回答2:


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




回答3:


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();



回答4:


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.




回答5:


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 !



来源:https://stackoverflow.com/questions/10841236/how-to-deal-with-image-quality-in-magento

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