Make WordPress Core


Ignore:
Timestamp:
06/28/2014 03:49:55 AM (12 years ago)
Author:
wonderboymusic
Message:

Add ->get_quality() method to WP_Image_Editor class.

Adds unit tests.

Props markoheijnen.
Fixes #28154.

File:
1 edited

Legend:

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

    r28640 r28879  
    115115                $this->mime_type = $size['mime'];
    116116
    117                 return $this->set_quality( $this->quality );
     117                return true;
    118118        }
    119119
     
    395395                }
    396396                elseif ( 'image/jpeg' == $mime_type ) {
    397                         if ( ! $this->make_image( $filename, 'imagejpeg', array( $image, $filename, $this->quality ) ) )
     397                        if ( ! $this->make_image( $filename, 'imagejpeg', array( $image, $filename, $this->get_quality() ) ) )
    398398                                return new WP_Error( 'image_save_error', __('Image Editor Save Failed') );
    399399                }
     
    443443                        default:
    444444                                header( 'Content-Type: image/jpeg' );
    445                                 return imagejpeg( $this->image, null, $this->quality );
     445                                return imagejpeg( $this->image, null, $this->get_quality() );
    446446                }
    447447        }
Note: See TracChangeset for help on using the changeset viewer.