Warning during gif thumbnails creation

  • Posts: 193
  • Thank you received: 76
9 years 10 months ago #186481

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.6.3
-- Error-message(debug-mod must be tuned on) -- : Warning: imagecolorsforindex(): Color index 255 out of range in administrator\components\com_hikashop\helpers\image.php on line 813

I have warning "Color index 255 out of range" with some gif images on listing pages when thumbnail was created on page load.
I think is because imagecolortransparent($img) must be less than imagecolorstotal($img).

Gifs in question attached.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 10 months ago #186532

Hi,

Thanks for the report ; it's the first time that I see someone using animated GIF in HikaShop :)
I made a fix which will be integrated int the next release.

if(in_array($extension,array('gif', 'png'))) {
	$palletSize = imagecolorstotal($img);
	if($transparentIndex >= 0 && $transparentIndex < $palletSize) {
		$trnprt_color = imagecolorsforindex($img, $transparentIndex);
Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum