WordPress.org

Make WordPress Core

Ticket #13461: 13461.5.patch

File 13461.5.patch, 1.0 KB (added by bpetty, 18 months ago)
  • wp-includes/media.php

    diff --git wp-includes/media.php wp-includes/media.php
    index 1dadc48..349fcec 100644
    function gd_edit_image_support($mime_type) { 
    943943 * @param int $height Image height 
    944944 * @return image resource 
    945945 */ 
    946 function wp_imagecreatetruecolor($width, $height) { 
    947         $img = imagecreatetruecolor($width, $height); 
    948         if ( is_resource($img) && function_exists('imagealphablending') && function_exists('imagesavealpha') ) { 
    949                 imagealphablending($img, false); 
    950                 imagesavealpha($img, true); 
     946function wp_imagecreatetruecolor( $width, $height ) { 
     947        $img = imagecreatetruecolor( $width, $height ); 
     948        if ( is_resource( $img ) && function_exists( 'imagealphablending' ) && function_exists( 'imagesavealpha' ) ) { 
     949                if ( function_exists( 'imagecolortransparent' ) && function_exists( 'imagecolorallocatealpha' ) ) 
     950                        imagecolortransparent( $img, imagecolorallocatealpha( $img, 0, 0, 0, 127 ) ); 
     951                imagealphablending( $img, false ); 
     952                imagesavealpha( $img, true ); 
    951953        } 
    952954        return $img; 
    953955}