Ticket #20848: custom-header.diff
File custom-header.diff, 1.3 KB (added by , 13 years ago) |
---|
-
custom-header.php
675 675 } elseif ( $width > HEADER_IMAGE_WIDTH ) { 676 676 $oitar = $width / HEADER_IMAGE_WIDTH; 677 677 $image = wp_crop_image($file, 0, 0, $width, $height, HEADER_IMAGE_WIDTH, $height / $oitar, false, str_replace(basename($file), 'midsize-'.basename($file), $file)); 678 //set permissions 679 $stat = @ stat( dirname( $image ) ); 680 $perms = $stat['mode'] & 0007777; 681 $perms = $perms & 0000666; 682 @ chmod( $image, $perms ); 683 clearstatcache(); 678 684 if ( is_wp_error( $image ) ) 679 685 wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) ); 680 686 … … 736 742 $original = get_attached_file($attachment_id); 737 743 738 744 $cropped = wp_crop_image( $attachment_id, (int) $_POST['x1'], (int) $_POST['y1'], (int) $_POST['width'], (int) $_POST['height'], HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT ); 745 //set permissions 746 $stat = @ stat( dirname( $cropped ) ); 747 $perms = $stat['mode'] & 0007777; 748 $perms = $perms & 0000666; 749 @ chmod( $cropped, $perms ); 750 clearstatcache(); 739 751 if ( is_wp_error( $cropped ) ) 740 752 wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) ); 741 753