diff --git a/src/wp-includes/class-wp-image-editor-gd.php b/src/wp-includes/class-wp-image-editor-gd.php
index 303f500..8c003e7 100644
a
|
b
|
class WP_Image_Editor_GD extends WP_Image_Editor { |
383 | 383 | if ( function_exists('imageistruecolor') && ! imageistruecolor( $image ) ) |
384 | 384 | imagetruecolortopalette( $image, false, imagecolorstotal( $image ) ); |
385 | 385 | |
386 | | if ( ! $this->make_image( $filename, 'imagepng', array( $image, $filename ) ) ) |
| 386 | // Invert the 1-100 quality scale and constrain it to 0-9, |
| 387 | // as per imagepng()'s peculiar quality parameter. |
| 388 | $compression_level = floor( ( 101 - $this->quality ) * 0.09 ); |
| 389 | |
| 390 | if ( ! $this->make_image( $filename, 'imagepng', array( $image, $filename, $compression_level ) ) ) { |
387 | 391 | return new WP_Error( 'image_save_error', __('Image Editor Save Failed') ); |
| 392 | } |
388 | 393 | } |
389 | 394 | elseif ( 'image/jpeg' == $mime_type ) { |
390 | 395 | if ( ! $this->make_image( $filename, 'imagejpeg', array( $image, $filename, $this->quality ) ) ) |