Page MenuHomePhabricator

Bitmap.diff

Authored By
bzimport
Nov 21 2014, 9:50 PM
Size
1 KB
Referenced Files
None
Subscribers
None

Bitmap.diff

Index: includes/media/Bitmap.php
===================================================================
--- includes/media/Bitmap.php (revision 24546)
+++ includes/media/Bitmap.php (working copy)
@@ -167,9 +167,18 @@
$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); //Turn off alphablending
+
imagecopyresampled( $dst_image, $src_image,
0,0,0,0,
$physicalWidth, $physicalHeight, imagesx( $src_image ), imagesy( $src_image ) );
+
+ imagesavealpha($dst_image, true); //Make sure the Alpha Channel (transparency) saves
+
call_user_func( $saveType, $dst_image, $dstPath );
imagedestroy( $dst_image );
imagedestroy( $src_image );

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3644
Default Alt Text
Bitmap.diff (1 KB)

Event Timeline