Index: trunk/wp-admin/custom-header.php =================================================================== --- trunk/wp-admin/custom-header.php (revision 20769) +++ trunk/wp-admin/custom-header.php (revision 20806) @@ -785,9 +785,13 @@ - + - +
@@ -868,10 +872,15 @@ $dst_width = get_theme_support( 'custom-header', 'width' ); - $cropped = wp_crop_image( $attachment_id, (int) $_POST['x1'], (int) $_POST['y1'], (int) $_POST['width'], (int) $_POST['height'], $dst_width, $dst_height ); + if ( empty( $_POST['skip-cropping'] ) ) + $cropped = wp_crop_image( $attachment_id, (int) $_POST['x1'], (int) $_POST['y1'], (int) $_POST['width'], (int) $_POST['height'], $dst_width, $dst_height ); + elseif ( ! empty( $_POST['create-new-attachment'] ) ) + $cropped = _copy_image_file( $attachment_id ); + else + $cropped = get_attached_file( $attachment_id ); + if ( ! $cropped || is_wp_error( $cropped ) ) wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) ); $cropped = apply_filters('wp_create_file_in_uploads', $cropped, $attachment_id); // For replication - $is_cropped = ( get_attached_file( $attachment_id ) != $cropped ); $parent = get_post($attachment_id); @@ -891,5 +900,5 @@ 'context' => 'custom-header' ); - if ( ! empty( $_POST['new-attachment'] ) ) + if ( ! empty( $_POST['create-new-attachment'] ) ) unset( $object['ID'] ); @@ -914,5 +923,5 @@ if ( file_exists( $medium ) ) @unlink( apply_filters( 'wp_delete_file', $medium ) ); - if ( empty( $_POST['new-attachment'] ) && $is_cropped ) + if ( empty( $_POST['create-new-attachment'] ) && empty( $_POST['skip-cropping'] ) ) @unlink( apply_filters( 'wp_delete_file', $original ) );