Jump to content

White border around pic


Recommended Posts

To change the color of the white background of the product images, you need to go to:

classes/imagemanager.php

 

line 174, you define the color ((it was 255, 255, 255), I placed 0, 0, 0

$transparent = imagecolorallocatealpha($dest_image, 0, 0, 0, 127);

 

Try this!

Link to comment
Share on other sites

The boarder is because of the size of image your are uploading vs the dimensions you have set in the back office for example your thickbox image is set at 600x400 HOWEVER your image you have uploaded is aprox 600x340 so id either uploading the image to fit all of the 600x400 space or to adjust the image dimensions. Once you adjust the image the white frame will still be visible so it would be best to just upload all of your images again working off the base size of 600x400

  • Like 1
Link to comment
Share on other sites

ok i did what you said and it did not work, i stil have the white bars. here is my code

 

{

imagealphablending($dest_image, false);

imagesavealpha($dest_image, true);

$transparent = imagecolorallocatealpha($dest_image, 0, 0, 0, 127);

imagefilledrectangle($dest_image, 0, 0, $dst_width, $dst_height, $transparent);

}

else

{

$white = imagecolorallocate($dest_image, 255, 255, 255);

imagefilledrectangle ($dest_image, 0, 0, $dst_width, $dst_height, $white);

}

Link to comment
Share on other sites

ok i changed the code so that it goes transparent. but that didnt' work. i've tried to resize the image using photoshop and created a pdf 600x400 pixels and fixed my picture to fit in it and did the back drop in blue which is the back ground of my site. and the pics if you notice on the site still have the pic, now blue bars and white bars around one of my pics. so resizing it did not work, i'm missing something but i can't pin point it. is the pixels size i chose right?

Link to comment
Share on other sites

You cant have a transparent jpg! PDFS are not a web image format. Yes your missing something as an example for this product:

 

http://scenteddeligh...troller=product

 

Your large image size is 600 x 400 (so thats the biggest file when i click to maximise the image), however your product image is 264x264 so its not within an aspect ratio of the original iamge, so your always going to get bars / empty space around the image.

 

Its a file size issue not a coding one. You need to make your images re-size within its maximum aspect ratio.

 

EDIT

 

So using 264x264 id suggest changing the thickbox image size to say 528x528 and then use the image I have attached ( no doubt you will need to redo it for a sharper image) but this will solve your problem

post-52110-0-56692400-1373006503_thumb.jpg

Edited by cocothecat (see edit history)
Link to comment
Share on other sites

  • 7 months later...

Some people may be lookin for classes/ImageManager.php find line: 1.5.6.2

 

if (Configuration::get('PS_IMAGE_GENERATION_METHOD') == 2 || (!Configuration::get('PS_IMAGE_GENERATION_METHOD') && $width_diff > $height_diff))

 

and change it to:

 

if (Configuration::get('PS_IMAGE_GENERATION_METHOD') == 2 || (!Configuration::get('PS_IMAGE_GENERATION_METHOD') && $width_diff < $height_diff))

 

now regenerate your images!

 

If thats not it, then go to your "images" and double check the sizes recommended by your template!

Link to comment
Share on other sites

×
×
  • Create New...