28 Jun 2017 
Support Center » Knowledgebase » Avactis 2.1.1 : Fix for transparent product's thumbnail image
 Avactis 2.1.1 : Fix for transparent product's thumbnail image
Solution
To save the transparent background of png images add the following code into your store.

Save a backup copy of the avactis-system/modules/product_images/product_images_api.php file.

Open your avactis-system/modules/product_images/product_images_api.php file.

1. Find the following line:


$dst_image = imagecreatetruecolor($dst_x, $dst_y);

and replace it with this one:

   $dst_image = imagecreatetruecolor($dst_x, $dst_y);
    imagecolortransparent($dst_image, imagecolorallocatealpha($dst_image, 0, 0, 0, 127));
    imagealphablending($dst_image, false);
    imagesavealpha($dst_image, true);

2. Replace the following line:

if (imagejpeg($dst_image, $new_image_path, $application->getAppIni('JPEG_THUMBNAIL_QUALITY')))

with this one:

if (imagepng($dst_image, $new_image_path))

Save the changes of this file.

Now Save a backup copy of the avactis-system/modules/catalog/catalog_api.php file.

Open your
avactis-system/modules/catalog/catalog_api.php file.

1. Find the following line:

$tmp_name = $product_info[$view_tag];

and replace it with this one:

$tmp_name = basename($product_info[$view_tag]);

This will keep the background of png images as it is.


Article Details
Article ID: 80
Created On: 12 Aug 2013 04:52 PM

 Login [Lost Password] 
Email:
Password:
Remember Me:
 
 Search
 Article Options
 Help Desk Menu

Help Desk Software By Kayako eSupport v3.11.01