mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
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
This commit is contained in:
parent
b7d31db410
commit
6806d48a90
@ -97,6 +97,11 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
|
||||
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'];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user