dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9025b4e
)
Fix f/ PNG-24 Alpha Transparency using GDLIB resizing
author
Tim Laqua
<tlaqua@users.mediawiki.org>
Wed, 22 Aug 2007 00:30:16 +0000
(
00:30
+0000)
committer
Tim Laqua
<tlaqua@users.mediawiki.org>
Wed, 22 Aug 2007 00:30:16 +0000
(
00:30
+0000)
includes/media/Bitmap.php
patch
|
blob
|
history
diff --git
a/includes/media/Bitmap.php
b/includes/media/Bitmap.php
index
dfa794b
..
c43e571
100644
(file)
--- a/
includes/media/Bitmap.php
+++ b/
includes/media/Bitmap.php
@@
-167,9
+167,18
@@
class BitmapHandler extends ImageHandler {
$src_image = call_user_func( $loader, $srcPath );
$dst_image = imagecreatetruecolor( $physicalWidth, $physicalHeight );
$src_image = call_user_func( $loader, $srcPath );
$dst_image = imagecreatetruecolor( $physicalWidth, $physicalHeight );
+
+ //PNG-24 Alpha Trans
+ $background = imagecolorallocate($dst_image, 0, 0, 0); //Make $dst_image all black
+ ImageColorTransparent($dst_image, $background); //Make $dst_image transparent
+ imagealphablending($dst_image, false);
+
imagecopyresampled( $dst_image, $src_image,
0,0,0,0,
$physicalWidth, $physicalHeight, imagesx( $src_image ), imagesy( $src_image ) );
imagecopyresampled( $dst_image, $src_image,
0,0,0,0,
$physicalWidth, $physicalHeight, imagesx( $src_image ), imagesy( $src_image ) );
+
+ imagesavealpha($dst_image, true);
+
call_user_func( $saveType, $dst_image, $dstPath );
imagedestroy( $dst_image );
imagedestroy( $src_image );
call_user_func( $saveType, $dst_image, $dstPath );
imagedestroy( $dst_image );
imagedestroy( $src_image );