Permalink
Browse files

Preserve alpha in WP_Image_Editor_GD when images are not resized.

Props joehoyle
see #23039


git-svn-id: http://core.svn.wordpress.org/trunk@23884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent b7d31db commit 6806d48a909b918fef76a41b965ea899acc1c89a Ryan Boren committed Apr 1, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 wp-includes/class-wp-image-editor-gd.php
View
5 wp-includes/class-wp-image-editor-gd.php
@@ -97,6 +97,11 @@ public function load() {
if ( ! $size )
return new WP_Error( 'invalid_image', __('Could not read image size.'), $this->file );
+ if ( function_exists( 'imagealphablending' ) && function_exists( 'imagesavealpha' ) ) {
+ imagealphablending( $this->image, false );
+ imagesavealpha( $this->image, true );
+ }
+
$this->update_size( $size[0], $size[1] );
$this->mime_type = $size['mime'];

0 comments on commit 6806d48

Please sign in to comment.