[wp-trac] Re: [WordPress Trac] #2805: Preserve PNG
transparency/alpha during thumbnail creation
WordPress Trac
wp-trac at lists.automattic.com
Sun Jul 29 16:01:05 GMT 2007
#2805: Preserve PNG transparency/alpha during thumbnail creation
----------------------------+-----------------------------------------------
Reporter: Libertus | Owner: anonymous
Type: defect | Status: reopened
Priority: normal | Milestone:
Component: Administration | Version: 2.1
Severity: normal | Resolution:
Keywords: |
----------------------------+-----------------------------------------------
Changes (by jberthon):
* status: closed => reopened
* resolution: wontfix =>
Comment:
I really wish this will be fixed!! This is really sad that WP lost the
transparency in the PNG... Why can't it be integrated into WP main code?
I have to do and redo the modification at each update!! :-(
After the line 2294 of this file:
http://trac.wordpress.org/browser/tags/2.2.1/wp-admin/admin-functions.php
add the following lines:
if ( ( $type[2] == 3) AND ( function_exists(
'imagesavealpha' ) ) ) {
imagesavealpha( $thumbnail, TRUE );
$trans_colour =
imagecolorallocatealpha($thumbnail, 0, 0, 0, 127);
imagefill($thumbnail, 0, 0,
$trans_colour);
}
This code was taken from this documentation page:
http://fr.php.net/manual/en/function.imagecreatetruecolor.php
--
Ticket URL: <http://trac.wordpress.org/ticket/2805#comment:3>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list