Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revisão 11953)
+++ wp-includes/post.php	(cópia de trabalho)
@@ -2601,7 +2601,7 @@
 	}
 
 	// remove intermediate and backup images if there are any
-	$sizes = apply_filters('intermediate_image_sizes', array('thumbnail', 'medium', 'large'));
+	$sizes = get_intermediate_sizes();
 	foreach ( $sizes as $size ) {
 		if ( $intermediate = image_get_intermediate_size($post_id, $size) ) {
 			$intermediate_file = apply_filters('wp_delete_file', $intermediate['path']);
@@ -2647,7 +2647,7 @@
 	$data = get_post_meta( $post->ID, '_wp_attachment_metadata', true );
 
 	if ( $remove_backups && isset($data['sizes']) && is_array($data['sizes']) ) {
-		$sizes = apply_filters( 'intermediate_image_sizes', array('large', 'medium', 'thumbnail') );
+		$sizes = get_intermediate_sizes();
 		foreach ( $data['sizes'] as $size => $val ) {
 			if ( !in_array( $size, $sizes, true ) )
 				unset($data['sizes'][$size]);
Index: wp-includes/media.php
===================================================================
--- wp-includes/media.php	(revisão 11953)
+++ wp-includes/media.php	(cópia de trabalho)
@@ -486,6 +486,60 @@
 }
 
 /**
+ * Get the available image sizes
+ * @since 2.9
+ * @param bool $unfiltered Optional, default is false. If set to true, returns unfiltered data
+ * @return array Returns a filtered array of image size strings
+ */
+function get_intermediate_sizes($unfiltered = false)
+{
+	$core = get_core_intermediate_sizes(true);
+	$custom = get_custom_intermediate_sizes(true);
+	
+	$intermediate_sizes = array_merge($core, $custom);
+	
+	if (!$unfiltered)
+		$intermediate_sizes = apply_filters('intermediate_image_sizes', $intermediate_sizes);
+	return $intermediate_sizes;
+}
+
+/**
+ * Get the core image sizes
+ * @since 2.9
+ * @param bool $unfiltered Optional, default is false. If set to true, returns unfiltered data
+ * @return array Returns a filtered array of image size strings
+ */
+function get_core_intermediate_sizes($unfiltered = false)
+{
+	$intermediate_sizes = array(__('Thumbnail') => 'thumbnail', __('Medium') => 'medium', __('Large') => 'large');
+	if (!$unfiltered)
+		$intermediate_sizes = apply_filters('intermediate_image_sizes', $intermediate_sizes);
+	return $intermediate_sizes;
+}
+
+/**
+ * Get the custom image sizes
+ * @since 2.9
+ * @param bool $unfiltered Optional, default is false. If set to true, returns unfiltered data
+ * @return array Returns a filtered array of image size strings
+ */
+function get_custom_intermediate_sizes($unfiltered = false)
+{
+	$intermediate_sizes = array();
+	$custom_sizes = get_option('custom_image_sizes');
+	if (is_array($custom_sizes)) {
+		foreach ($custom_sizes as $size) {
+			$intermediate_sizes[$size] = sanitize_title_with_dashes($size);
+		}
+	}
+
+	if (!$unfiltered)
+		$intermediate_sizes = apply_filters('intermediate_image_sizes', $intermediate_sizes);
+	return $intermediate_sizes;
+}
+
+
+/**
  * Retrieve an image to represent an attachment.
  *
  * A mime icon for files, thumbnail or intermediate size for images.
Index: wp-admin/admin-ajax.php
===================================================================
--- wp-admin/admin-ajax.php	(revisão 11953)
+++ wp-admin/admin-ajax.php	(cópia de trabalho)
@@ -1373,6 +1373,83 @@
 
 	die();
 	break;
+case 'custom-image-size-add' :
+	
+	if (isset($_POST['new_size_name']) && $_POST['new_size_name'] != '') {
+		$custom_sizes = get_option('custom_image_sizes');
+		$name = $_POST['new_size_name'];
+		$slug = sanitize_title_with_dashes($name);
+		$protected_names = array('Full size', 'Thumbnail', 'Medium', 'Large');
+		
+		if (is_array($custom_sizes)) {
+			
+			// check for duplicates
+			if ( in_array($name, $custom_sizes) ) {
+				$suffix = 2;
+				do {
+					$alt_name = substr($name, 0, 200-(strlen($suffix)+1)). "-$suffix";
+					$check_name = in_array($alt_name, $custom_sizes);
+					$suffix++;
+				} while ($check_name);
+				$name = $alt_name;
+				$slug = sanitize_title_with_dashes($name);
+			}
+			array_push($custom_sizes, $name);
+		} else {
+			$custom_sizes = array($name);
+		}
+
+		if (!in_array($name, $protected_names) && update_option('custom_image_sizes', $custom_sizes)) {
+			$op = '<tr valign="top">
+				<th scope="row">
+					<span class="size_name">
+						' . $name . '
+					</span>
+					<p style="margin: 0;">
+					<a style="display: none; cursor: pointer;" class="remove_custom_size delete">
+					' . __('Remove') . '
+					</a>
+					</p>
+				</th>
+				<td>
+				<label for="' . $slug . '_size_w">' . __('Max Width') . '</label>
+				<input name="' . $slug . '_size_w" type="text" id="' . $slug . '_size_w" value="" class="small-text" />
+				<label for="' . $slug . '_size_h">' . __('Max Height') . '</label>
+				<input name="' . $slug . '_size_h" type="text" id="' . $slug . '_size_h" value="" class="small-text" /><br />
+				<input name="' . $slug . '_crop" type="checkbox" id="' . $slug . '_crop" value="1" />
+				<label for="' . $slug . '_crop">' . __('Crop image to exact dimensions') . '</label>
+				</td>
+				</tr>';
+			
+				echo $op;
+		}
+		  
+	}
+	
+	break;
+
+case 'custom-image-size-remove' :
+
+	$custom_sizes = get_option('custom_image_sizes');
+	$name = $_POST['size_name'];
+	
+	if (is_array($custom_sizes)) {
+		$key = array_search($name, $custom_sizes);
+		array_splice($custom_sizes, $key, 1);
+		
+		$slug = sanitize_title_with_dashes($name);
+		delete_option($slug . '_size_w');
+		delete_option($slug . '_size_h');
+		delete_option($slug . '_crop');
+		
+		update_option('custom_image_sizes', $custom_sizes);
+		echo 'ok';
+	}
+	
+	
+	
+	break;
+	
 default :
 	do_action( 'wp_ajax_' . $_POST['action'] );
 	die('0');
Index: wp-admin/includes/image-edit.php
===================================================================
--- wp-admin/includes/image-edit.php	(revisão 11953)
+++ wp-admin/includes/image-edit.php	(cópia de trabalho)
@@ -13,16 +13,9 @@
 
 	$meta = wp_get_attachment_metadata($post_id);
 	if ( is_array($meta) && is_array($meta['sizes']) ) {
-		$sizes = apply_filters('intermediate_image_sizes', array('thumbnail', 'medium', 'large'));
-		$size_names = array(
-			'thumbnail' => __('thumbnail'),
-			'medium' => __('medium'),
-			'large' => __('large')
-		);
-
-		foreach ( $sizes as $size ) {
+		$sizes = get_intermediate_sizes();
+		foreach ( $sizes as $size_name => $size ) {
 			if ( array_key_exists($size, $meta['sizes']) ) {
-				$size_name = isset($size_names[$size]) ? $size_names[$size] : $size;
 				$image_size_opt .= "<option value='$size'>$size_name</option>\n";
 			}
 		}
@@ -371,7 +364,7 @@
 		$meta['hwstring_small'] = "height='$uheight' width='$uwidth'";
 
 		if ( $success && $target == 'all' )
-			$sizes = apply_filters( 'intermediate_image_sizes', array('large', 'medium', 'thumbnail') );
+			$sizes = get_intermediate_sizes();
 
 		$msg .= "full={$meta['width']}x{$meta['height']}!";
 	} elseif ( array_key_exists($target, $meta['sizes']) ) {
Index: wp-admin/includes/media.php
===================================================================
--- wp-admin/includes/media.php	(revisão 11953)
+++ wp-admin/includes/media.php	(cópia de trabalho)
@@ -797,9 +797,10 @@
 function image_size_input_fields( $post, $checked = '' ) {
 
 		// get a list of the actual pixel dimensions of each possible intermediate version of this image
-		$size_names = array('thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full size'));
+		$size_names = get_intermediate_sizes(); 
+		$size_names[__('Full size')] = 'full';
 
-		foreach ( $size_names as $size => $name ) {
+		foreach ( $size_names as $name => $size ) {
 			$downsize = image_downsize($post->ID, $size);
 
 			// is this size selectable?
Index: wp-admin/includes/image.php
===================================================================
--- wp-admin/includes/image.php	(revisão 11953)
+++ wp-admin/includes/image.php	(cópia de trabalho)
@@ -105,8 +105,7 @@
 		$metadata['file'] = $file;
 
 		// make thumbnails and other intermediate sizes
-		$sizes = array('thumbnail', 'medium', 'large');
-		$sizes = apply_filters('intermediate_image_sizes', $sizes);
+		$sizes = get_intermediate_sizes();
 
 		foreach ($sizes as $size) {
 			$resized = image_make_intermediate_size( $full_path_file, get_option("{$size}_size_w"), get_option("{$size}_size_h"), get_option("{$size}_crop") );
@@ -294,6 +293,25 @@
 }
 
 /**
+ * Updates all image metadata and, by consequence, regenerates thumbnails
+ *
+ * @since 2.9.0
+ *
+ * @param int $attachment_id Attachment Id to process.
+ * @return Array|bool Attachment metadata. False on failure.
+ */
+function wp_update_image_thumbs($attachment_id) {
+	$fullsizepath = get_attached_file( $attachment_id );
+	if ( FALSE !== $fullsizepath && @file_exists($fullsizepath) && file_is_valid_image($fullsizepath)) {
+		set_time_limit( 30 );
+		if (wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $fullsizepath ) ) )
+			return wp_get_attachment_metadata( $attachment_id );
+	}
+	return false;
+}
+
+
+/**
  * Validate that file is an image.
  *
  * @since 2.5.0
Index: wp-admin/js/options-media.js
===================================================================
--- wp-admin/js/options-media.js	(revisão 0)
+++ wp-admin/js/options-media.js	(revisão 0)
@@ -0,0 +1,95 @@
+jQuery(document).ready(function($) {
+
+	$('.remove_custom_size').hide().removeAttr('href');
+	
+	$('form').submit(function() {
+		$('#new_size').val('');
+	});
+	
+	$('#new_size').keypress(function(e) {
+		if (13 == e.keyCode){
+			addNewSize();
+			return false;
+		}
+	}).after('<a style="cursor: pointer;" id="add_new_size">'+messages.add_label+'</a>');
+	
+	$('#add_new_size').click(function() {
+		addNewSize();
+	});
+	
+	$('#image_sizes_table').find('tr').mouseover(function() {
+		new_size_over($(this))
+		}).mouseout(function() {
+       		new_size_out($(this));
+       	}).find('.remove_custom_size').click(function() {
+    		remove_custom_size($(this));
+    	});
+	
+	function new_size_over(tr) {
+		tr.find('.remove_custom_size').show();
+	}
+	
+	function new_size_out(tr) {
+		tr.find('.remove_custom_size').hide();
+	}
+	
+	function remove_custom_size(button) {
+		if (confirm(messages.confirm_remove)) {
+			var name = button.parents('th').find('span.size_name').html();
+			del_size = $.ajax({
+	            type: 'POST',
+	            url: ajaxurl,
+	            dataType: 'html',
+	            data: {
+					size_name: name,
+					action: 'custom-image-size-remove'
+	            },
+	            
+	            complete: function() {
+	                if (del_size.responseText == 'ok') {
+	                	button.parents('tr').animate({backgroundColor: "#bf5e5e"}, 300).animate({opacity: "hide"}, 1000, "", function(){
+							$(this).remove();
+						});
+	                } else
+	                	alert(messages.error_remove);
+	            }
+	        });
+		}
+	}
+	
+	function addNewSize() {
+		
+		var sizeName = $('#new_size').val();
+		if (!sizeName) {
+			alert(messages.error_add_blank);
+			return;
+		}
+		new_size = $.ajax({
+            type: 'POST',
+            url: ajaxurl,
+            dataType: 'html',
+            data: {
+				new_size_name: sizeName,
+				action: 'custom-image-size-add'
+            },
+            
+            complete: function() {
+                if (new_size.responseText) {
+                	var htmlBgColor = $('html').css('backgroundColor');
+                	$('#image_sizes_table').append(new_size.responseText).find('tr:last').css('background-color', htmlBgColor).animate({backgroundColor: "#FFFFE0"}, 400).animate({backgroundColor: htmlBgColor}, 1000).mouseover(function() {
+                		new_size_over($(this));
+                	}).mouseout(function() {
+                		new_size_out($(this));
+                	}).find('.remove_custom_size').click(function() {
+                		remove_custom_size($(this));
+                	});
+                } else {
+                	alert(messages.error_add);
+                }
+            }
+        });
+		
+	}
+
+
+});
Index: wp-admin/options-media.php
===================================================================
--- wp-admin/options-media.php	(revisão 11953)
+++ wp-admin/options-media.php	(cópia de trabalho)
@@ -9,6 +9,37 @@
 /** WordPress Administration Bootstrap */
 require_once('admin.php');
 
+wp_enqueue_script('options-media', admin_url() . '/js/options-media.js', array('jquery'));
+wp_localize_script('options-media', 'messages', array(
+    'confirm_remove' => __('Are you sure you want to remove this size?'),
+    'error_remove' => __('Fail to remove this size'),
+    'error_add' => __('Fail to add size. Try using a different name'),
+    'error_add_blank' => __('Please fill in a name for the new size'),
+    'add_label' => __('Add')
+));
+
+// Handle delete custom size
+if ($_GET['action'] == 'delete_custom_size' && $_GET['size_name'] != '') {
+	
+	$custom_sizes = get_option('custom_image_sizes');
+	$name = $_GET['size_name'];
+	
+	if (is_array($custom_sizes)) {
+		$key = array_search($name, $custom_sizes);
+		array_splice($custom_sizes, $key, 1);
+		
+		$slug = sanitize_title_with_dashes($name);
+		delete_option($slug . '_size_w');
+		delete_option($slug . '_size_h');
+		delete_option($slug . '_crop');
+		
+		update_option('custom_image_sizes', $custom_sizes);
+		$goback = add_query_arg( 'updated', 'true', wp_get_referer() );
+		wp_redirect( $goback );
+	}
+	
+}
+
 if ( ! current_user_can('manage_options') )
 	wp_die(__('You do not have sufficient permissions to manage options for this blog.'));
 
@@ -23,56 +54,153 @@
 <?php screen_icon(); ?>
 <h2><?php echo esc_html( $title ); ?></h2>
 
-<form action="options.php" method="post">
-<?php settings_fields('media'); ?>
+<?php if (!$_POST['regen-thumbs']) : ?>
+	<form action="options.php" method="post">
+	<?php settings_fields('media'); ?>
 
-<h3><?php _e('Image sizes') ?></h3>
-<p><?php _e('The sizes listed below determine the maximum dimensions in pixels to use when inserting an image into the body of a post.'); ?></p>
+	<h3><?php _e('Image sizes') ?></h3>
+	<p><?php _e('The sizes listed below determine the maximum dimensions in pixels to use when inserting an image into the body of a post.'); ?></p>
 
-<table class="form-table">
-<tr valign="top">
-<th scope="row"><?php _e('Thumbnail size') ?></th>
-<td>
-<label for="thumbnail_size_w"><?php _e('Width'); ?></label>
-<input name="thumbnail_size_w" type="text" id="thumbnail_size_w" value="<?php form_option('thumbnail_size_w'); ?>" class="small-text" />
-<label for="thumbnail_size_h"><?php _e('Height'); ?></label>
-<input name="thumbnail_size_h" type="text" id="thumbnail_size_h" value="<?php form_option('thumbnail_size_h'); ?>" class="small-text" /><br />
-<input name="thumbnail_crop" type="checkbox" id="thumbnail_crop" value="1" <?php checked('1', get_option('thumbnail_crop')); ?>/>
-<label for="thumbnail_crop"><?php _e('Crop thumbnail to exact dimensions (normally thumbnails are proportional)'); ?></label>
-</td>
-</tr>
+	<table class="form-table" id="image_sizes_table">
+	<tr valign="top">
+	<th scope="row"><?php _e('Thumbnail size') ?></th>
+	<td>
+	<label for="thumbnail_size_w"><?php _e('Width'); ?></label>
+	<input name="thumbnail_size_w" type="text" id="thumbnail_size_w" value="<?php form_option('thumbnail_size_w'); ?>" class="small-text" />
+	<label for="thumbnail_size_h"><?php _e('Height'); ?></label>
+	<input name="thumbnail_size_h" type="text" id="thumbnail_size_h" value="<?php form_option('thumbnail_size_h'); ?>" class="small-text" /><br />
+	<input name="thumbnail_crop" type="checkbox" id="thumbnail_crop" value="1" <?php checked('1', get_option('thumbnail_crop')); ?>/>
+	<label for="thumbnail_crop"><?php _e('Crop thumbnail to exact dimensions (normally thumbnails are proportional)'); ?></label>
+	</td>
+	</tr>
 
-<tr valign="top">
-<th scope="row"><?php _e('Medium size') ?></th>
-<td><fieldset><legend class="screen-reader-text"><span><?php _e('Medium size') ?></span></legend>
-<label for="medium_size_w"><?php _e('Max Width'); ?></label>
-<input name="medium_size_w" type="text" id="medium_size_w" value="<?php form_option('medium_size_w'); ?>" class="small-text" />
-<label for="medium_size_h"><?php _e('Max Height'); ?></label>
-<input name="medium_size_h" type="text" id="medium_size_h" value="<?php form_option('medium_size_h'); ?>" class="small-text" />
-</fieldset></td>
-</tr>
+	<tr valign="top">
+	<th scope="row"><?php _e('Medium size') ?></th>
+	<td><fieldset><legend class="screen-reader-text"><span><?php _e('Medium size') ?></span></legend>
+	<label for="medium_size_w"><?php _e('Max Width'); ?></label>
+	<input name="medium_size_w" type="text" id="medium_size_w" value="<?php form_option('medium_size_w'); ?>" class="small-text" />
+	<label for="medium_size_h"><?php _e('Max Height'); ?></label>
+	<input name="medium_size_h" type="text" id="medium_size_h" value="<?php form_option('medium_size_h'); ?>" class="small-text" />
+	</fieldset></td>
+	</tr>
 
-<tr valign="top">
-<th scope="row"><?php _e('Large size') ?></th>
-<td><fieldset><legend class="screen-reader-text"><span><?php _e('Large size') ?></span></legend>
-<label for="large_size_w"><?php _e('Max Width'); ?></label>
-<input name="large_size_w" type="text" id="large_size_w" value="<?php form_option('large_size_w'); ?>" class="small-text" />
-<label for="large_size_h"><?php _e('Max Height'); ?></label>
-<input name="large_size_h" type="text" id="large_size_h" value="<?php form_option('large_size_h'); ?>" class="small-text" />
-</fieldset></td>
-</tr>
+	<tr valign="top">
+	<th scope="row"><?php _e('Large size') ?></th>
+	<td><fieldset><legend class="screen-reader-text"><span><?php _e('Large size') ?></span></legend>
+	<label for="large_size_w"><?php _e('Max Width'); ?></label>
+	<input name="large_size_w" type="text" id="large_size_w" value="<?php form_option('large_size_w'); ?>" class="small-text" />
+	<label for="large_size_h"><?php _e('Max Height'); ?></label>
+	<input name="large_size_h" type="text" id="large_size_h" value="<?php form_option('large_size_h'); ?>" class="small-text" />
+	</fieldset></td>
+	</tr>
 
-<?php do_settings_fields('media', 'default'); ?>
-</table>
+	<?php 
 
-<?php do_settings_sections('media'); ?>
+	$custom_sizes = get_custom_intermediate_sizes();
 
-<p class="submit">
-	<input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" />
-</p>
+	if (is_array($custom_sizes)) :
+		foreach ($custom_sizes as $name => $size) : 
+	?>
+			<tr valign="top">
+				<th scope="row">
+					<span class="size_name"><?php echo $name; ?></span>
+					<p style="margin: 0;">
+						<a style="cursor: pointer;" class="remove_custom_size delete" href="<?php echo add_query_arg(array('action' => 'delete_custom_size', 'size_name' => $name)); ?>">
+							<?php _e('Remove'); ?>
+						</a>
+					</p>
+				</th>
+				<td>
+					<label for="<?php echo $size; ?>_size_w"><?php _e('Max Width'); ?></label>
+					<input name="<?php echo $size; ?>_size_w" type="text" id="<?php echo $size; ?>_size_w" value="<?php form_option($size . '_size_w'); ?>" class="small-text" />
+					<label for="<?php echo $size; ?>_size_h"><?php _e('Max Height'); ?></label>
+					<input name="<?php echo $size; ?>_size_h" type="text" id="<?php echo $size; ?>_size_h" value="<?php form_option($size . '_size_h'); ?>" class="small-text" /><br />
+					<input name="<?php echo $size; ?>_crop" type="checkbox" id="<?php echo $size; ?>_crop" value="1" <?php checked('1', get_option($size . '_crop')); ?>/>
+					<label for="<?php echo $size; ?>_crop"><?php _e('Crop image to exact dimensions'); ?></label>
+				</td>
+			</tr>
 
-</form>
+	<?php 
+		endforeach;
+	endif; //is_array($custom_sizes)
 
+	?>
+	</table>
+
+	<table class="form-table">
+	<tr valign="top">
+	<th scope="row"><?php _e('Add new') ?></th>
+	<td>
+	<label for="new_size"><?php _e('New size name'); ?></label>
+	<input name="new_size" type="text" id="new_size" value="" />
+
+	</td>
+	</tr>
+
+
+	<?php do_settings_fields('media', 'default'); ?>
+	</table>
+
+
+	<?php do_settings_sections('media'); ?>
+
+	<p class="submit">
+		<input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" />
+	</p>
+
+	</form>
+
+	<h2><?php _e('Regenerate all thumbnails'); ?></h2>
+
+	<form method="post" action="<?php echo remove_query_arg('updated'); ?>">
+
+	<p><?php _e('If you change the values of the sizes you might want to regenerate all your image thumbnails to fit the new values. (Please note that if you have a lot of images this proccess can take a long time)'); ?></p>
+
+	<p class="submit">
+		<input type="submit" name="regen-thumbs" class="button-primary" value="<?php esc_attr_e('Regenerate all thumbnails') ?>" />
+	</p>
+
+	</form>
+
+<?php else : // not regenerating thumbs ?>
+
+	<h2><?php _e('Regenarating thumbnails'); ?></h2>
+	
+	<p><?php _e('This proccess can take a while depending on the number of images you have. Leave this window open while it proccess.'); ?></p>
+
+	<?php
+	
+	$attachments =& get_children( array(
+		'post_type' => 'attachment',
+		'post_mime_type' => 'image',
+		'numberposts' => -1,
+		'post_status' => null,
+		'post_parent' => null, // any parent
+		'output' => 'object',
+	) );
+
+	// Check for results
+	if ( FALSE === $attachments ) {
+		echo '	<p>' . __( "No images were found." ) . "</p>\n\n";
+	} else {
+		$count = 0;
+		echo "	<ol>\n";
+		foreach ( $attachments as $attachment ) {
+			$lastImage = wp_update_image_thumbs($attachment->ID);
+			echo '<li>', $lastImage['file'], '</li>';
+			$count ++;
+			ob_flush();
+			flush();
+		}
+		echo "	</ol>\n\n";
+		echo '	<p>' . sprintf( __( 'All done! Processed %d attachments.' ), $count );
+		echo ' <a href="', admin_url(), 'options-media.php">', __('Go back'), '.</a>';
+		echo "</p>\n\n";
+	}
+	?>
+
+<?php endif; ?>
+
 </div>
 
 <?php include('./admin-footer.php'); ?>
Index: wp-admin/options.php
===================================================================
--- wp-admin/options.php	(revisão 11953)
+++ wp-admin/options.php	(cópia de trabalho)
@@ -25,7 +25,7 @@
 	'general' => array( 'blogname', 'blogdescription', 'admin_email', 'users_can_register', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'default_role', 'timezone_string' ),
 	'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration' ),
 	'misc' => array( 'use_linksupdate', 'uploads_use_yearmonth_folders', 'upload_path', 'upload_url_path' ),
-	'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type' ),
+	'media' => array( 'image_default_size', 'image_default_align', 'image_default_link_type' ),
 	'privacy' => array( 'blog_public' ),
 	'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'blog_charset', 'show_on_front', 'page_on_front', 'page_for_posts' ),
 	'writing' => array( 'default_post_edit_rows', 'use_smilies', 'ping_sites', 'mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'enable_app', 'enable_xmlrpc' ),
@@ -33,6 +33,15 @@
 if ( !defined( 'WP_SITEURL' ) ) $whitelist_options['general'][] = 'siteurl';
 if ( !defined( 'WP_HOME' ) ) $whitelist_options['general'][] = 'home';
 
+// Get image sizes
+if ($image_sizes = get_intermediate_sizes()) {
+	foreach ($image_sizes as $size) {
+		array_push($whitelist_options['media'], $size . '_size_w');
+		array_push($whitelist_options['media'], $size . '_size_h');
+		array_push($whitelist_options['media'], $size . '_crop');
+	}
+}
+
 $whitelist_options = apply_filters( 'whitelist_options', $whitelist_options );
 
 if ( !current_user_can('manage_options') )
@@ -67,6 +76,29 @@
 			$_POST['time_format'] = $_POST['time_format_custom'];
 	}
 
+	// Handle custom image sizes
+	if (isset($_POST['new_size']) && $_POST['new_size'] != '') {
+		$custom_sizes = get_option('custom_image_sizes');
+		$newCustomSizeName = $_POST['new_size'];
+		$protected_names = array('Full size', 'Thumbnail', 'Medium', 'Large');
+		if (is_array($custom_sizes)) {
+			// check for duplicates
+			if ( in_array($newCustomSizeName, $custom_sizes) ) {
+				$suffix = 2;
+				do {
+					$alt_name = substr($newCustomSizeName, 0, 200-(strlen($suffix)+1)). "-$suffix";
+					$check_name = in_array($alt_name, $custom_sizes);
+					$suffix++;
+				} while ($check_name);
+				$newCustomSizeName = $alt_name;
+			}
+			array_push($custom_sizes, $newCustomSizeName);
+		} else {
+			$custom_sizes = array($newCustomSizeName);
+		}
+		if (!in_array($newCustomSizeName, $protected_names)) update_option('custom_image_sizes', $custom_sizes);
+	}
+
 	if ( $options ) {
 		foreach ( $options as $option ) {
 			$option = trim($option);
Index: wp-admin/css/media.css
===================================================================
--- wp-admin/css/media.css	(revisão 11953)
+++ wp-admin/css/media.css	(cópia de trabalho)
@@ -1 +1 @@
-div#media-upload-header{margin:0;padding:0 5px;font-weight:bold;position:relative;border-bottom-width:1px;border-bottom-style:solid;height:2.5em;}body#media-upload ul#sidemenu{font-weight:normal;margin:0 5px;position:absolute;left:0;bottom:-1px;}div#media-upload-error{margin:1em;font-weight:bold;}form{margin:1em;}#search-filter{text-align:right;}th{position:relative;}.media-upload-form label.form-help,td.help{font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-style:italic;font-weight:normal;}.media-upload-form p.help{margin:0;padding:0;}.media-upload-form fieldset{width:100%;border:none;text-align:justify;margin:0 0 1em 0;padding:0;}.image-align-none-label{background:url(../images/align-none.png) no-repeat center left;}.image-align-left-label{background:url(../images/align-left.png) no-repeat center left;}.image-align-center-label{background:url(../images/align-center.png) no-repeat center left;}.image-align-right-label{background:url(../images/align-right.png) no-repeat center left;}tr.image-size td{width:460px;}tr.image-size div.image-size-item{float:left;width:25%;margin:0;}#library-form .progress,#gallery-form .progress,#flash-upload-ui,.insert-gallery,.describe.startopen,.describe.startclosed{display:none;}.media-item .thumbnail{max-width:128px;max-height:128px;}thead.media-item-info tr{background-color:transparent;}thead.media-item-info th,thead.media-item-info td{border:none;margin:0;}.form-table thead.media-item-info{border:8px solid #fff;}abbr.required{text-decoration:none;border:none;}.describe label{display:inline;}.describe td{vertical-align:middle;padding:0 5px 0 0;}.describe td.A1{width:132px;}.describe input[type="text"],.describe textarea{width:460px;border-width:1px;border-style:solid;}.describe-toggle-on,.describe-toggle-off{display:block;line-height:36px;float:right;margin-right:20px;}.describe-toggle-off{display:none;}.hidden{height:0;width:0;overflow:hidden;border:none;}#media-upload .media-upload-form p{margin:0 1em 1em 0;}#media-upload p.ml-submit{padding:1em 0;}#media-upload p.help,#media-upload label.help{font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-style:italic;font-weight:normal;}#media-upload tr.image-size td.field{text-align:center;}#media-upload #media-items{border-width:1px;border-style:solid;border-bottom:none;width:623px;}#media-upload .media-item{border-bottom-width:1px;border-bottom-style:solid;min-height:36px;width:100%;}#media-upload .ui-sortable .media-item{cursor:move;}.filename{line-height:36px;padding:0 10px;overflow:hidden;}#media-upload .describe{padding:5px;width:100%;clear:both;cursor:default;}#media-upload .slidetoggle{border-top-width:1px;border-top-style:solid;}#media-upload .describe th.label{padding-top:.5em;text-align:left;min-width:120px;}#media-upload tr.align td.field{text-align:center;}#media-upload tr.image-size{margin-bottom:1em;height:3em;}#media-upload #filter{width:623px;}#media-upload #filter .subsubsub{margin:8px 0;}#filter .tablenav select{border-style:solid;border-width:1px;padding:2px;vertical-align:top;width:auto;}#media-upload .del-attachment{display:none;margin:5px 0;}.menu_order{float:right;font-size:11px;margin:10px 10px 0;}.menu_order_input{border:1px solid #ddd;font-size:10px;padding:1px;width:23px;}.ui-sortable-helper{background-color:#fff;border:1px solid #aaa;opacity:.6;filter:alpha(opacity=60);}#media-upload th.order-head{width:25%;text-align:center;}#media-upload .widefat{width:626px;border-style:solid solid none;}.sorthelper{height:37px;width:623px;display:block;}#gallery-settings th.label{width:160px;}#gallery-settings #basic th.label{padding:5px 5px 5px 0;}#gallery-settings .title{clear:both;padding:0 0 3px;border-bottom-style:solid;border-bottom-width:1px;font-family:Georgia,"Times New Roman",Times,serif;font-size:1.6em;border-bottom-color:#DADADA;color:#5A5A5A;}h3.media-title{color:#5A5A5A;font-family:Georgia,"Times New Roman",Times,serif;font-size:1.6em;font-weight:normal;}#gallery-settings .describe td{vertical-align:middle;height:3.5em;}#gallery-settings .describe th.label{padding-top:.5em;text-align:left;}#gallery-settings .describe{padding:5px;width:615px;clear:both;cursor:default;}#gallery-settings .describe select{width:15em;border:1px solid #dfdfdf;}#gallery-settings label,#gallery-settings legend{font-size:13px;color:#464646;margin-right:15px;}#gallery-settings .align .field label{margin:0 1.5em 0 0;}#gallery-settings p.ml-submit{border-top:1px solid #dfdfdf;}#gallery-settings select#columns{width:6em;}#sort-buttons{font-size:.8em;margin:3px 25px -8px 0;text-align:right;max-width:625px;}#sort-buttons a{text-decoration:none;}#sort-buttons #asc,#sort-buttons #showall{padding-left:5px;}#sort-buttons span{margin-right:25px;}
\ No newline at end of file
+div#media-upload-header{margin:0;padding:0 5px;font-weight:bold;position:relative;border-bottom-width:1px;border-bottom-style:solid;height:2.5em;}body#media-upload ul#sidemenu{font-weight:normal;margin:0 5px;position:absolute;left:0;bottom:-1px;}div#media-upload-error{margin:1em;font-weight:bold;}form{margin:1em;}#search-filter{text-align:right;}th{position:relative;}.media-upload-form label.form-help,td.help{font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-style:italic;font-weight:normal;}.media-upload-form p.help{margin:0;padding:0;}.media-upload-form fieldset{width:100%;border:none;text-align:justify;margin:0 0 1em 0;padding:0;}.image-align-none-label{background:url(../images/align-none.png) no-repeat center left;}.image-align-left-label{background:url(../images/align-left.png) no-repeat center left;}.image-align-center-label{background:url(../images/align-center.png) no-repeat center left;}.image-align-right-label{background:url(../images/align-right.png) no-repeat center left;}tr.image-size td{width:460px;}tr.image-size div.image-size-item{float:left;width:25%;margin:0;min-height: 45px;height: auto !important;height: 45px;}#library-form .progress,#gallery-form .progress,#flash-upload-ui,.insert-gallery,.describe.startopen,.describe.startclosed{display:none;}.media-item .thumbnail{max-width:128px;max-height:128px;}thead.media-item-info tr{background-color:transparent;}thead.media-item-info th,thead.media-item-info td{border:none;margin:0;}.form-table thead.media-item-info{border:8px solid #fff;}abbr.required{text-decoration:none;border:none;}.describe label{display:inline;}.describe td{vertical-align:middle;padding:0 5px 0 0;}.describe td.A1{width:132px;}.describe input[type="text"],.describe textarea{width:460px;border-width:1px;border-style:solid;}.describe-toggle-on,.describe-toggle-off{display:block;line-height:36px;float:right;margin-right:20px;}.describe-toggle-off{display:none;}.hidden{height:0;width:0;overflow:hidden;border:none;}#media-upload .media-upload-form p{margin:0 1em 1em 0;}#media-upload p.ml-submit{padding:1em 0;}#media-upload p.help,#media-upload label.help{font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-style:italic;font-weight:normal;}#media-upload tr.image-size td.field{text-align:center;}#media-upload #media-items{border-width:1px;border-style:solid;border-bottom:none;width:623px;}#media-upload .media-item{border-bottom-width:1px;border-bottom-style:solid;min-height:36px;width:100%;}#media-upload .ui-sortable .media-item{cursor:move;}.filename{line-height:36px;padding:0 10px;overflow:hidden;}#media-upload .describe{padding:5px;width:100%;clear:both;cursor:default;}#media-upload .slidetoggle{border-top-width:1px;border-top-style:solid;}#media-upload .describe th.label{padding-top:.5em;text-align:left;min-width:120px;}#media-upload tr.align td.field{text-align:center;}#media-upload tr.image-size{margin-bottom:1em;height:3em;}#media-upload #filter{width:623px;}#media-upload #filter .subsubsub{margin:8px 0;}#filter .tablenav select{border-style:solid;border-width:1px;padding:2px;vertical-align:top;width:auto;}#media-upload .del-attachment{display:none;margin:5px 0;}.menu_order{float:right;font-size:11px;margin:10px 10px 0;}.menu_order_input{border:1px solid #ddd;font-size:10px;padding:1px;width:23px;}.ui-sortable-helper{background-color:#fff;border:1px solid #aaa;opacity:.6;filter:alpha(opacity=60);}#media-upload th.order-head{width:25%;text-align:center;}#media-upload .widefat{width:626px;border-style:solid solid none;}.sorthelper{height:37px;width:623px;display:block;}#gallery-settings th.label{width:160px;}#gallery-settings #basic th.label{padding:5px 5px 5px 0;}#gallery-settings .title{clear:both;padding:0 0 3px;border-bottom-style:solid;border-bottom-width:1px;font-family:Georgia,"Times New Roman",Times,serif;font-size:1.6em;border-bottom-color:#DADADA;color:#5A5A5A;}h3.media-title{color:#5A5A5A;font-family:Georgia,"Times New Roman",Times,serif;font-size:1.6em;font-weight:normal;}#gallery-settings .describe td{vertical-align:middle;height:3.5em;}#gallery-settings .describe th.label{padding-top:.5em;text-align:left;}#gallery-settings .describe{padding:5px;width:615px;clear:both;cursor:default;}#gallery-settings .describe select{width:15em;border:1px solid #dfdfdf;}#gallery-settings label,#gallery-settings legend{font-size:13px;color:#464646;margin-right:15px;}#gallery-settings .align .field label{margin:0 1.5em 0 0;}#gallery-settings p.ml-submit{border-top:1px solid #dfdfdf;}#gallery-settings select#columns{width:6em;}#sort-buttons{font-size:.8em;margin:3px 25px -8px 0;text-align:right;max-width:625px;}#sort-buttons a{text-decoration:none;}#sort-buttons #asc,#sort-buttons #showall{padding-left:5px;}#sort-buttons span{margin-right:25px;}
\ No newline at end of file
Index: wp-admin/css/media.dev.css
===================================================================
--- wp-admin/css/media.dev.css	(revisão 11953)
+++ wp-admin/css/media.dev.css	(cópia de trabalho)
@@ -79,6 +79,9 @@
 	float: left;
 	width: 25%;
 	margin: 0;
+	min-height: 45px;
+	height: auto !important;
+	height: 45px;
 }
 
 #library-form .progress,
