r25023 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25022‎ | r25023 | r25024 >
Date:00:30, 22 August 2007
Author:tlaqua
Status:old
Tags:
Comment:
Fix f/ PNG-24 Alpha Transparency using GDLIB resizing
Modified paths:
  • /trunk/phase3/includes/media/Bitmap.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/media/Bitmap.php
@@ -167,9 +167,18 @@
168168
169169 $src_image = call_user_func( $loader, $srcPath );
170170 $dst_image = imagecreatetruecolor( $physicalWidth, $physicalHeight );
 171+
 172+ //PNG-24 Alpha Trans
 173+ $background = imagecolorallocate($dst_image, 0, 0, 0); //Make $dst_image all black
 174+ ImageColorTransparent($dst_image, $background); //Make $dst_image transparent
 175+ imagealphablending($dst_image, false);
 176+
171177 imagecopyresampled( $dst_image, $src_image,
172178 0,0,0,0,
173179 $physicalWidth, $physicalHeight, imagesx( $src_image ), imagesy( $src_image ) );
 180+
 181+ imagesavealpha($dst_image, true);
 182+
174183 call_user_func( $saveType, $dst_image, $dstPath );
175184 imagedestroy( $dst_image );
176185 imagedestroy( $src_image );

Follow-up revisions

RevisionCommit summaryAuthorDate
r25109Merged revisions 25016-25108 via svnmerge from...david07:30, 24 August 2007

Status & tagging log