Changeset 23873
- Timestamp:
- 03/29/2013 08:51:35 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
wp-admin/custom-header.php (modified) (1 diff)
-
wp-admin/includes/image-edit.php (modified) (5 diffs)
-
wp-admin/includes/media.php (modified) (2 diffs)
-
wp-includes/media.php (modified) (3 diffs)
-
wp-includes/theme.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/custom-header.php
r23554 r23873 664 664 } else { 665 665 $data = wp_get_attachment_metadata( $attachment_id ); 666 $height = $data[ 'height' ];667 $width = $data[ 'width' ];666 $height = isset( $data[ 'height' ] ) ? $data[ 'height' ] : 0; 667 $width = isset( $data[ 'width' ] ) ? $data[ 'width' ] : 0; 668 668 unset( $data ); 669 669 } -
trunk/wp-admin/includes/image-edit.php
r23563 r23873 14 14 $note = ''; 15 15 16 if ( is _array($meta) && isset($meta['width']) )16 if ( isset( $meta['width'], $meta['height'] ) ) 17 17 $big = max( $meta['width'], $meta['height'] ); 18 18 else … … 22 22 23 23 $backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true ); 24 $can_restore = !empty($backup_sizes) && isset($backup_sizes['full-orig']) 25 && $backup_sizes['full-orig']['file'] != basename($meta['file']); 24 $can_restore = false; 25 if ( ! empty( $backup_sizes ) && isset( $backup_sizes['full-orig'], $meta['file'] ) ) 26 $can_restore = $backup_sizes['full-orig']['file'] != basename( $meta['file'] ); 26 27 27 28 if ( $msg ) { … … 64 65 <input type="hidden" id="imgedit-undone-<?php echo $post_id; ?>" value="0" /> 65 66 <input type="hidden" id="imgedit-selection-<?php echo $post_id; ?>" value="" /> 66 <input type="hidden" id="imgedit-x-<?php echo $post_id; ?>" value="<?php echo $meta['width']; ?>" />67 <input type="hidden" id="imgedit-y-<?php echo $post_id; ?>" value="<?php echo $meta['height']; ?>" />67 <input type="hidden" id="imgedit-x-<?php echo $post_id; ?>" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" /> 68 <input type="hidden" id="imgedit-y-<?php echo $post_id; ?>" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" /> 68 69 69 70 <div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap"> … … 83 84 <div class="imgedit-help"> 84 85 <p><?php _e('You can proportionally scale the original image. For best results the scaling should be done before performing any other operations on it like crop, rotate, etc. Note that if you make the image larger it may become fuzzy.'); ?></p> 86 <?php if ( isset( $meta['width'], $meta['height'] ) ): ?> 85 87 <p><?php printf( __('Original dimensions %s'), $meta['width'] . '×' . $meta['height'] ); ?></p> 88 <?php endif ?> 86 89 <div class="imgedit-submit"> 87 <span class="nowrap"><input type="text" id="imgedit-scale-width-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1)" style="width:4em;" value="<?php echo $meta['width']; ?>" />×<input type="text" id="imgedit-scale-height-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0)" style="width:4em;" value="<?php echo $meta['height']; ?>" />90 <span class="nowrap"><input type="text" id="imgedit-scale-width-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1)" style="width:4em;" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" />×<input type="text" id="imgedit-scale-height-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0)" style="width:4em;" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" /> 88 91 <span class="imgedit-scale-warn" id="imgedit-scale-warn-<?php echo $post_id; ?>">!</span></span> 89 92 <input type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'scale')" class="button-primary" value="<?php esc_attr_e( 'Scale' ); ?>" /> … … 500 503 @unlink($delpath); 501 504 } 502 } else {505 } elseif ( isset( $meta['width'], $meta['height'] ) ) { 503 506 $backup_sizes["full-$suffix"] = array('width' => $meta['width'], 'height' => $meta['height'], 'file' => $parts['basename']); 504 507 } -
trunk/wp-admin/includes/media.php
r23768 r23873 1128 1128 $media_dims = ''; 1129 1129 $meta = wp_get_attachment_metadata( $post->ID ); 1130 if ( is _array( $meta ) && array_key_exists( 'width', $meta ) && array_key_exists( 'height', $meta) )1130 if ( isset( $meta['width'], $meta['height'] ) ) 1131 1131 $media_dims .= "<span id='media-dims-$post->ID'>{$meta['width']} × {$meta['height']}</span> "; 1132 1132 $media_dims = apply_filters( 'media_meta', $media_dims, $post ); … … 2369 2369 $media_dims = ''; 2370 2370 $meta = wp_get_attachment_metadata( $post->ID ); 2371 if ( is _array( $meta ) && array_key_exists( 'width', $meta ) && array_key_exists( 'height', $meta) )2371 if ( isset( $meta['width'], $meta['height'] ) ) 2372 2372 $media_dims .= "<span id='media-dims-$post->ID'>{$meta['width']} × {$meta['height']}</span> "; 2373 2373 $media_dims = apply_filters( 'media_meta', $media_dims, $post ); -
trunk/wp-includes/media.php
r23869 r23873 165 165 } 166 166 } 167 if ( !$width && !$height && isset( $meta['width'], $meta['height']) ) {167 if ( !$width && !$height && isset( $meta['width'], $meta['height'] ) ) { 168 168 // any other type: use the real image 169 169 $width = $meta['width']; … … 781 781 $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false); 782 782 $image_meta = wp_get_attachment_metadata( $id ); 783 $orientation = ( $image_meta['height'] > $image_meta['width'] ) ? 'portrait' : 'landscape'; 783 784 $orientation = ''; 785 if ( isset( $image_meta['height'], $image_meta['width'] ) ) 786 $orientation = ( $image_meta['height'] > $image_meta['width'] ) ? 'portrait' : 'landscape'; 784 787 785 788 $output .= "<{$itemtag} class='gallery-item'>"; … … 1627 1630 } 1628 1631 1629 $sizes['full'] = array( 1630 'height' => $meta['height'], 1631 'width' => $meta['width'], 1632 'url' => $attachment_url, 1633 'orientation' => $meta['height'] > $meta['width'] ? 'portrait' : 'landscape', 1634 ); 1632 $sizes['full'] = array( 'url' => $attachment_url ); 1633 1634 if ( isset( $meta['height'], $meta['width'] ) ) { 1635 $sizes['full']['height'] = $meta['height']; 1636 $sizes['full']['width'] = $meta['width']; 1637 $sizes['full']['orientation'] = $meta['height'] > $meta['width'] ? 'portrait' : 'landscape'; 1638 } 1635 1639 1636 1640 $response = array_merge( $response, array( 'sizes' => $sizes ), $sizes['full'] ); -
trunk/wp-includes/theme.php
r23633 r23873 1014 1014 $header_images[$header_index]['url'] = $url; 1015 1015 $header_images[$header_index]['thumbnail_url'] = $url; 1016 $header_images[$header_index]['width'] = $header_data['width']; 1017 $header_images[$header_index]['height'] = $header_data['height']; 1016 if ( isset( $header_data['width'] ) ) 1017 $header_images[$header_index]['width'] = $header_data['width']; 1018 if ( isset( $header_data['height'] ) ) 1019 $header_images[$header_index]['height'] = $header_data['height']; 1018 1020 } 1019 1021
Note: See TracChangeset
for help on using the changeset viewer.