2

enter image description here

All images get these white borders around them all over the page. Even in product view and category view. I havent found any CSS that would do that and would'nt belive it is some kind of plugin. Is anyone experienced that before?

Magento 1.9.3

To clarify: these white areas appear even when I insert image as big as the container

1 Answer 1

3

This is not css issue. When you resize the image the magento will automatically add the white background to fill the container size. use keepFrame(false)

$this->helper('catalog/image')->init($_product, 'small_image')->keepFrame(false)->resize($_imgSize);

here are example1 example2 how to remove white background

5
  • I have both media.phtml files that my theme is using and neither has "keepFrame" in them. The way these images are called is: <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile()); ?>" alt="<?php echo $this->escapeHtml($_image->getLabel()) ?>" /> or
    – raouaoul
    Jan 18, 2017 at 13:36
  • @raulicious use keepFrame(false) will remove white background Jan 18, 2017 at 17:10
  • I added keepFrame(false) before every resize() callout in media.phtml, but the white borders did'nt go away. Should I also remove resize maybe?
    – raouaoul
    Jan 19, 2017 at 7:11
  • @raulicious try with different size then if it worked then remove and clear cache before maybe cache is reason or delete var/cache folder too Jan 19, 2017 at 7:13
  • 1
    It worked now, template path hints was giving me wrong template information to look at, that is why it did'nt work at first. Thanks!
    – raouaoul
    Jan 19, 2017 at 11:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.