Ticket #19118: media.php.patch
| File media.php.patch, 1.2 KB (added by mzaweb, 19 months ago) |
|---|
-
wp-includes/media.php
375 375 list( $new_w, $new_h ) = wp_constrain_dimensions( $orig_w, $orig_h, $dest_w, $dest_h ); 376 376 } 377 377 378 // if the resulting image would be the same size or larger we don't want to resize it379 if ( $new_w >= $orig_w && $new_h >= $orig_h )380 return false;381 382 378 // the return array matches the parameters to imagecopyresampled() 383 379 // int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h 384 380 return array( 0, 0, (int) $s_x, (int) $s_y, (int) $new_w, (int) $new_h, (int) $crop_w, (int) $crop_h ); … … 423 419 return new WP_Error( 'error_getting_dimensions', __('Could not calculate resized image dimensions') ); 424 420 list($dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) = $dims; 425 421 422 // if the resulting image would be the same size or larger we don't want to resize it 423 if ( $dst_w >= $orig_w && $dst_h >= $orig_h ) 424 return $file; 425 426 426 $newimage = wp_imagecreatetruecolor( $dst_w, $dst_h ); 427 427 428 428 imagecopyresampled( $newimage, $image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
