简体   繁体   English

我的magento主题主页中的图像模糊了

[英]Images get blurred in my magento theme homepage

I am new to magento. 我是magento的新手。 I am using a theme 'rwd'. 我正在使用主题'rwd'。 The product images get blurred when its listed on home page. 在主页上列出的产品图像变得模糊。

With Inspect element, I found that its natural image size is 85x85. 使用Inspect元素,我发现其自然图像大小为85x85。 But re-sized to 140x140. 但重新调整到140x140。 How do i set the image to 140x140 or any other procedure to be taken care for image resolutions? 如何将图像设置为140x140或任何其他程序来处理图像分辨率?

Try this one : 试试这个:

Go to the file view.xml which you can find in code/Magento/Catalog/etc/ . 转到文件view.xml ,您可以在code/Magento/Catalog/etc/

Open the file and edit line 31 from : 打开文件并编辑第31行:

<var name="product_small_image_sidebar_size">85</var>

to : 至 :

<var name="product_small_image_sidebar_size">140</var>

If you look inside the template file: 如果您查看模板文件:

app\\design\\frontend\\rwd\\default\\template\\catalog\\product\\list.phtml

you will find around line 128 (Magento 1.9.1.x) the image size setting for the Grid View: 你会发现第128行(Magento 1.9.1.x)网格视图的图像大小设置:

<?php $_imgSize = 85; ?>

just change the value to the one you need. 只需将值更改为您需要的值。 After clearing Magento image cache you will find that the small images will be created at the resolution you set, thus not involving the poor browser resize. 清除Magento图像缓存后,您会发现将以您设置的分辨率创建小图像,因此不会涉及较差的浏览器调整大小。

In .phtml files there are many of these $_imgSize settings related to the different views, just do a text search for the string. 在.phtml文件中,有许多与不同视图相关的$_imgSize设置,只需对字符串进行文本搜索。

I think in your case is the uploaded image size is smaller and in default magento resizes product image to 140x140.So in this case the image tends to expand and hence it looks blurr. 我认为在你的情况下,上传的图像尺寸较小,默认情况下magento将产品图像调整为140x140.So在这种情况下,图像趋于扩展,因此看起来更模糊。

One solution would be to upload an image with large size. 一种解决方案是上传大尺寸的图像。

I think you should open the magento project with a good text editing software such as sublime text 2 , and then do a research in the whole project (ctrl + alt + F) , and look for the string '140' . 我认为你应该用一个好的文本编辑软件打开magento项目,如sublime text 2 ,然后在整个项目中进行研究(ctrl + alt + F) ,并查找字符串'140'

That way you may find the place where magendo defines the size to which magendo resizes your image. 这样你就可以找到magendo定义magendo调整图像大小的地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM