Make WordPress Core

Ticket #51038: 51038.diff

File 51038.diff, 695 bytes (added by munyagu, 4 years ago)
  • src/wp-includes/class-wp-image-editor-gd.php

     
    307307         * @return bool|WP_Error
    308308         */
    309309        public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) {
     310                // If source height isn't specified,
     311                // use height of the source file.
     312                if( ! $src_h ) {
     313                        $size = getimagesize( $this->file );
     314                        $src_h = $size[1];
     315                }
     316
    310317                // If destination width/height isn't specified,
    311318                // use same as width/height from source.
    312319                if ( ! $dst_w ) {