Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F4079
Bitmap.diff
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
•
bzimport
Nov 21 2014, 9:50 PM
2014-11-21 21:50:41 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
Bitmap.diff
View Options
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
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3644
Default Alt Text
Bitmap.diff (1 KB)
Attached To
Mode
T12783: Resizing PNG-24 images causes all alpha channel transparency to be lost and transparent pixels to be turned black
Attached
Detach File
Event Timeline
Log In to Comment