Opened 10 years ago

Closed 9 years ago

#5529 closed Bug (fixed)

CKFinder loose png transparency on thumbnails (PHP)

Reported by: Benoît Geeraerts Owned by:
Priority: Normal Milestone:
Component: Server : PHP Version:
Keywords: Cc:

Description

I don't know if it's clear enough on the screenshot but the "buy" button (3rd image) should have transparent rounded borders but they appear black. This is caused by imagecopyresampled not keeping trancparency on png.

http://img638.imageshack.us/img638/2710/screenshot20100413at132.png

Here is a fix for this : in CommandHandler/Thumbnails.php

add this code after the line

$oThumbImage = imagecreatetruecolor($oSize["Width"], $oSize["Height"]); 

(line 237)

if($sourceImageAttr['mime'] == 'image/png'){
imagecolortransparent($oThumbImage, imagecolorallocate($oThumbImage, 0, 0, 0));
imagealphablending($oThumbImage, false);
imagesavealpha($oThumbImage, true);
} 

Regards,

Ben.

Change History (2)

comment:1 Changed 10 years ago by Benoît Geeraerts

Looks like my fix does not work properly, sorry.

May be related to the $quality test on fastImageCopyResampled function.

Here is the buy button so you can test.

http://img532.imageshack.us/img532/7357/tempimage11.png

comment:2 Changed 9 years ago by Wiktor Walc

Resolution: fixed
Status: newclosed

Fixed in 2.0.2. Thanks for reporting it.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy