summaryrefslogtreecommitdiffstats
path: root/wp-admin/upload-functions.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-12-11 11:45:03 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-12-11 11:45:03 +0000
commit040b8591582940de99442bb1de04afdf9d3daf59 (patch)
treeceaa054562fa6089c307b48fc30e963eee357e73 /wp-admin/upload-functions.php
parent91725f574d4fa83b30d8d7c2794e9f078628e6da (diff)
downloadwordpress-mu-040b8591582940de99442bb1de04afdf9d3daf59.tar.gz
wordpress-mu-040b8591582940de99442bb1de04afdf9d3daf59.tar.xz
wordpress-mu-040b8591582940de99442bb1de04afdf9d3daf59.zip
WP Merge to rev 4640
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@823 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/upload-functions.php')
-rw-r--r--wp-admin/upload-functions.php29
1 files changed, 1 insertions, 28 deletions
diff --git a/wp-admin/upload-functions.php b/wp-admin/upload-functions.php
index 11f3b77..3b093d1 100644
--- a/wp-admin/upload-functions.php
+++ b/wp-admin/upload-functions.php
@@ -220,34 +220,7 @@ function wp_upload_tab_upload_action() {
// Save the data
$id = wp_insert_attachment($attachment, $file, $post_id);
- if ( preg_match('!^image/!', $attachment['post_mime_type']) ) {
- // Generate the attachment's postmeta.
- $imagesize = getimagesize($file);
- $imagedata['width'] = $imagesize['0'];
- $imagedata['height'] = $imagesize['1'];
- list($uwidth, $uheight) = get_udims($imagedata['width'], $imagedata['height']);
- $imagedata['hwstring_small'] = "height='$uheight' width='$uwidth'";
- $imagedata['file'] = $file;
-
- wp_update_attachment_metadata( $id, $imagedata );
-
- if ( $imagedata['width'] * $imagedata['height'] < 3 * 1024 * 1024 ) {
- if ( $imagedata['width'] > 128 && $imagedata['width'] >= $imagedata['height'] * 4 / 3 )
- $thumb = wp_create_thumbnail($file, 128);
- elseif ( $imagedata['height'] > 96 )
- $thumb = wp_create_thumbnail($file, 96);
-
- if ( @file_exists($thumb) ) {
- $newdata = $imagedata;
- $newdata['thumb'] = basename($thumb);
- wp_update_attachment_metadata( $id, $newdata );
- } else {
- $error = $thumb;
- }
- }
- } else {
- wp_update_attachment_metadata( $id, array() );
- }
+ wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
wp_redirect( get_option('siteurl') . "/wp-admin/upload.php?style=$style&tab=browse&action=view&ID=$id&post_id=$post_id");
die;