Jump to content

Changing product item background fill colour


BrainSuperGlue

Recommended Posts

Hi,

I need a sanity check on something for Prestashop 1.6

Currently the fill colour of a product is white and I need it to be black.

Doing research I went into /classes/ImageManager.php and changed the 255,255,255 at the end of the $white line to 0,0,0

 

{
			$white = imagecolorallocate($dest_image, 0, 0, 0);
			imagefilledrectangle ($dest_image, 0, 0, $dst_width, $dst_height, $white);
		}

I also went into /webservice/WebserviceSpecificManagementImages.php and changed the 255,255,255 on the $white line to 0,0,0
 

if (
!($destImage = imagecreatetruecolor($destWidth, $destHeight)) ||
!($white = imagecolorallocate($destImage, 0, 0, 0)) ||

Cleared the cache on both the store site and the browser but the fill was still white
Changed the Images from JPG to all PNG but still white
Retriggered the thumbnails to be rebuilt, still white.

Have I missed something obvious?

Thanks 

BSG

post-1227072-0-35691000-1502054854_thumb.jpg

post-1227072-0-40705900-1502054859_thumb.jpg

Link to comment
Share on other sites

According to the PS 1.6.1.13 code, the PNG images are filled with transparent background. If you try with PNG, you could change ImageManager from this line

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

to

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

Also note that the definition of $white or $transparent is done at several places in ImageManager.php. If counted 4 places.

Have you changed them all or only at one place?

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...