WordPress.org

Make WordPress Core

Changeset 23103


Ignore:
Timestamp:
12/06/2012 07:56:04 AM (8 years ago)
Author:
nacin
Message:

Image editors: After cropping, request new sizes from the image. If we rely on the values passed in, they may be floats. We must see what the image results in.

Cast in update_size() for sanity.

props DH-Shredder.
fixes #22779.

Location:
trunk/wp-includes
Files:
3 edited

Legend:

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

    r23038 r23103  
    242242            imagedestroy( $this->image );
    243243            $this->image = $dst;
    244             $this->update_size( $dst_w, $dst_h );
     244            $this->update_size();
    245245            return true;
    246246        }
  • trunk/wp-includes/class-wp-image-editor-imagick.php

    r23038 r23103  
    318318
    319319                $this->image->scaleImage( $dst_w, $dst_h );
    320                 return $this->update_size( $dst_w, $dst_h );
     320                return $this->update_size();
    321321            }
    322322        }
     
    324324            return new WP_Error( 'image_crop_error', $e->getMessage() );
    325325        }
    326         return $this->update_size( $src_w, $src_h );
     326        return $this->update_size();
    327327    }
    328328
  • trunk/wp-includes/class-wp-image-editor.php

    r23038 r23103  
    186186    protected function update_size( $width = null, $height = null ) {
    187187        $this->size = array(
    188             'width' => $width,
    189             'height' => $height
     188            'width' => (int) $width,
     189            'height' => (int) $height
    190190        );
    191191        return true;
Note: See TracChangeset for help on using the changeset viewer.