Changeset 49751 for trunk/src/wp-includes/class-wp-image-editor-gd.php
- Timestamp:
- 12/04/2020 09:39:30 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-image-editor-gd.php
r49019 r49751 324 324 } 325 325 326 $dst = wp_imagecreatetruecolor( $dst_w, $dst_h ); 326 foreach ( array( $src_w, $src_h, $dst_w, $dst_h ) as $value ) { 327 if ( ! is_numeric( $value ) || (int) $value <= 0 ) { 328 return new WP_Error( 'image_crop_error', __( 'Image crop failed.' ), $this->file ); 329 } 330 } 331 332 $dst = wp_imagecreatetruecolor( (int) $dst_w, (int) $dst_h ); 327 333 328 334 if ( $src_abs ) { … … 335 341 } 336 342 337 imagecopyresampled( $dst, $this->image, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w,$src_h );343 imagecopyresampled( $dst, $this->image, 0, 0, (int) $src_x, (int) $src_y, (int) $dst_w, (int) $dst_h, (int) $src_w, (int) $src_h ); 338 344 339 345 if ( is_gd_image( $dst ) ) {
Note: See TracChangeset
for help on using the changeset viewer.