Skip to content

Commit

Permalink
Preserve alpha in WP_Image_Editor_GD when images are not resized.
Browse files Browse the repository at this point in the history
Props joehoyle
see #23039


git-svn-id: http://core.svn.wordpress.org/trunk@23884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
Ryan Boren committed Apr 1, 2013
1 parent b7d31db commit 6806d48
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wp-includes/class-wp-image-editor-gd.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ public function load() {
if ( ! $size ) if ( ! $size )
return new WP_Error( 'invalid_image', __('Could not read image size.'), $this->file ); 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->update_size( $size[0], $size[1] );
$this->mime_type = $size['mime']; $this->mime_type = $size['mime'];


Expand Down

0 comments on commit 6806d48

Please sign in to comment.