Contact Us

  • Call Now:0161 670 6064
  • Email Adress:support@citricmedia.co.uk
  • Address Info:125 Greenleach Lane, Worsley, M28 2RS

Close Support

Support

Remove white image frame on images Magento

Remove white image frame on images Magento
  • 6
    Jun

Remove white image frame on images Magento

Are your images showing a white frame left and right or top and bottom on your images in magento?

So you’ve uploaded your images and for no apparent reason they suddenly show a white border and look awful.

The fix is in three maybe more places depending on your theme.

The code that needs adding to fix it is as follows.

->backgroundColor(array(0,0,0))

The position of this code should be around line 62 in app/design/frontend/default/default or theme folder/template/catalog/product/view/media.phtml

Should read like this before changes

<p class=”product-image”>
<?php
$_img = ‘<img src=”‘.$this->helper(‘catalog/image’)->init($_product, ‘image’)->resize(265).'” alt=”‘.$this->htmlEscape($this->getImageLabel()).'” title=”‘.$this->htmlEscape($this->getImageLabel()).'” />’;
echo $_helper->productAttribute($_product, $_img, ‘image’);
?>

Should read like this after changes marked in RED

<p class=”product-image”>
<?php
$_img = ‘<img src=”‘.$this->helper(‘catalog/image’)->init($_product, ‘image’)->backgroundColor(array(0,0,0))->resize(265).'” alt=”‘.$this->htmlEscape($this->getImageLabel()).'” title=”‘.$this->htmlEscape($this->getImageLabel()).'” />’;
echo $_helper->productAttribute($_product, $_img, ‘image’);
?>

 

You may also need to look for the same info in the following files.

/app/design/frontend/base/default/template/catalog/product/new.phtml

/app/design/frontend/base/default/template/catalog/product/grid.phtml

/app/design/frontend/base/default/template/catalog/product/list.phtml

Comments are closed.

We use cookies to ensure that we give you the best experience on our website.