Make WordPress Core

Ticket #20848: custom-header.diff

File custom-header.diff, 1.3 KB (added by gtenney99, 13 years ago)
  • custom-header.php

     
    675675                } elseif ( $width > HEADER_IMAGE_WIDTH ) {
    676676                        $oitar = $width / HEADER_IMAGE_WIDTH;
    677677                        $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();
    678684                        if ( is_wp_error( $image ) )
    679685                                wp_die( __( 'Image could not be processed.  Please go back and try again.' ), __( 'Image Processing Error' ) );
    680686
     
    736742                $original = get_attached_file($attachment_id);
    737743
    738744                $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();
    739751                if ( is_wp_error( $cropped ) )
    740752                        wp_die( __( 'Image could not be processed.  Please go back and try again.' ), __( 'Image Processing Error' ) );
    741753