Magento – black background in thumbnails

imagemagento-1.8product

my new generated product thumbnails have a black instead of a white background, but i dind't change anything. How can i change settings like that? i tried settings the background image with the helper function but that didn't help…

Mage::helper('catalog/image')->init($product, 'thumbnail', $image->getFile())->backgroundColor(255, 255, 255)->resize(400)

EDIT

It is very confusing… The Problem doesn't exist on any image. I attached two images of a product. The 1st image gets a white and the 2nd a black background. Here's my source code to receive the thumbnails in the template /catalog/product/view/media.phtml:

foreach ($this->getGalleryImages() as $_image) { $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(301); }

If i add a background color of red like the following, only the 1st image will get that. The 2nd image is still black.

$this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->backgroundColor(array(255, 0, 0))->resize(301);

The magento version is 1.8.1. I tried that images in a magento installation with the version 1.9.1 where the problem doesn't exist…

Thanks for any help!

white background
black background

Best Answer

You need to check for the parent div stylings, the image it self has white background but it seems that the problem is from the parent div. Use Firebug or Chrome's developer tools for troubleshooting the reason of the problem.


Update:

Go with this:

Mage::helper('catalog/image')->init($product, 'thumbnail', $image->getFile())->backgroundColor(array(255, 255, 255))->resize(400)
Related Topic