Changeset 20384 for trunk/wp-admin/custom-header.php
- Timestamp:
- 04/06/2012 08:47:24 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/custom-header.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/custom-header.php
r20358 r20384 701 701 } 702 702 703 list($width, $height, $type, $attr) = getimagesize( $file ); 703 if ( file_exists( $file ) ) { 704 list( $width, $height, $type, $attr ) = getimagesize( $file ); 705 } else { 706 $data = wp_get_attachment_metadata( $id ); 707 $height = $data[ 'height' ]; 708 $width = $data[ 'width' ]; 709 unset( $data ); 710 } 704 711 705 712 $max_width = 0; … … 717 724 { 718 725 // Add the meta-data 719 wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) ); 726 if ( file_exists( $file ) ) 727 wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) ); 720 728 update_post_meta( $id, '_wp_attachment_is_custom_header', get_option('stylesheet' ) ); 721 729 … … 725 733 } elseif ( $width > $max_width ) { 726 734 $oitar = $width / $max_width; 727 $image = wp_crop_image($ file, 0, 0, $width, $height, $max_width, $height / $oitar, false, str_replace(basename($file), 'midsize-'.basename($file), $file));735 $image = wp_crop_image($id, 0, 0, $width, $height, $max_width, $height / $oitar, false, str_replace(basename($file), 'midsize-'.basename($file), $file)); 728 736 if ( is_wp_error( $image ) ) 729 737 wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) );
Note: See TracChangeset
for help on using the changeset viewer.