Ticket #3596: 3596.diff
| File 3596.diff, 1.6 KB (added by , 20 years ago) |
|---|
-
wp-admin/upload-functions.php
3 3 global $post; 4 4 $id = get_the_ID(); 5 5 $attachment_data = wp_get_attachment_metadata( $id ); 6 $is_image = (int) wp_attachment_is_image(); 7 if ( !isset($attachment_data['width']) && $is_image ) { 8 $image_data = getimagesize( get_attached_file( $id ) ); 9 $attachment_data['width'] = $image_data[0]; 10 $attachment_data['height'] = $image_data[1]; 11 wp_update_attachment_metadata( $id, $attachment_data ); 12 } 6 13 if ( isset($attachment_data['width']) ) 7 14 list($width,$height) = wp_shrink_dimensions($attachment_data['width'], $attachment_data['height'], 171, 128); 15 8 16 ob_start(); 9 17 the_title(); 10 18 $post_title = attribute_escape(ob_get_contents()); … … 43 51 $r .= "\t\t\t\t<input type='hidden' name='attachment-thumb-url-$id' id='attachment-thumb-url-$id' value='$thumb_rel' />\n"; 44 52 $r .= "\t\t\t\t<input type='hidden' name='attachment-thumb-url-base-$id' id='attachment-thumb-url-base-$id' value='$thumb_base' />\n"; 45 53 } 46 $is_image = (int) wp_attachment_is_image(); 54 47 55 $r .= "\t\t\t\t<input type='hidden' name='attachment-is-image-$id' id='attachment-is-image-$id' value='$is_image' />\n"; 56 48 57 if ( isset($width) ) { 49 58 $r .= "\t\t\t\t<input type='hidden' name='attachment-width-$id' id='attachment-width-$id' value='$width' />\n"; 50 59 $r .= "\t\t\t\t<input type='hidden' name='attachment-height-$id' id='attachment-height-$id' value='$height' />\n";
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)