Make WordPress Core

Changeset 23884


Ignore:
Timestamp:
04/01/2013 03:21:19 PM (12 years ago)
Author:
ryan
Message:

Preserve alpha in WP_Image_Editor_GD when images are not resized.

Props joehoyle
see #23039

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-image-editor-gd.php

    r23750 r23884  
    9797        if ( ! $size )
    9898            return new WP_Error( 'invalid_image', __('Could not read image size.'), $this->file );
     99
     100        if ( function_exists( 'imagealphablending' ) && function_exists( 'imagesavealpha' ) ) {
     101            imagealphablending( $this->image, false );
     102            imagesavealpha( $this->image, true );
     103        }
    99104
    100105        $this->update_size( $size[0], $size[1] );
Note: See TracChangeset for help on using the changeset viewer.