WordPress.org

Make WordPress Core

Ticket #24380: class-wp-image-editor-gd.2.diff

File class-wp-image-editor-gd.2.diff, 818 bytes (added by markoheijnen, 6 months ago)

Spacing and add comment

  • wp-includes/class-wp-image-editor-gd.php

     
    353353                        if ( function_exists('imageistruecolor') && ! imageistruecolor( $image ) ) 
    354354                                imagetruecolortopalette( $image, false, imagecolorstotal( $image ) ); 
    355355 
    356                         if ( ! $this->make_image( $filename, 'imagepng', array( $image, $filename ) ) ) 
     356                        $compression = - ( ( 0.09 * $this->quality ) - 9 ); // from 0 (no compression) to 9. 
     357                         
     358                        if ( ! $this->make_image( $filename, 'imagepng', array( $image, $filename, $compression ) ) ) 
    357359                                return new WP_Error( 'image_save_error', __('Image Editor Save Failed') ); 
    358360                } 
    359361                elseif ( 'image/jpeg' == $mime_type ) {