### Eclipse Workspace Patch 1.0
#P wordpress-trunk bare
Index: wp-includes/default-constants.php
===================================================================
--- wp-includes/default-constants.php	(revision 17523)
+++ wp-includes/default-constants.php	(working copy)
@@ -23,6 +23,10 @@
 			define('WP_MEMORY_LIMIT', '32M');
 		}
 	}
+	
+	if ( !defined('WP_MAX_MEMORY_LIMIT') ) {
+		define('WP_MAX_MEMORY_LIMIT', '256M');
+	}
 
 	/**
 	 * The $blog_id global, which you can change in the config allows you to create a simple
Index: wp-admin/admin.php
===================================================================
--- wp-admin/admin.php	(revision 17523)
+++ wp-admin/admin.php	(working copy)
@@ -106,7 +106,7 @@
 	require(ABSPATH . 'wp-admin/menu.php');
 
 if ( current_user_can( 'manage_options' ) )
-	@ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', '256M' ) );
+	@ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
 
 do_action('admin_init');
 
Index: wp-admin/includes/file.php
===================================================================
--- wp-admin/includes/file.php	(revision 17523)
+++ wp-admin/includes/file.php	(working copy)
@@ -563,7 +563,7 @@
 		return new WP_Error('fs_unavailable', __('Could not access filesystem.'));
 
 	// Unzip can use a lot of memory, but not this much hopefully
-	@ini_set('memory_limit', '256M');
+	@ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
 
 	$needed_dirs = array();
 	$to = trailingslashit($to);
Index: wp-includes/media.php
===================================================================
--- wp-includes/media.php	(revision 17523)
+++ wp-includes/media.php	(working copy)
@@ -250,7 +250,7 @@
 		return __('The GD image library is not installed.');
 
 	// Set artificially high because GD uses uncompressed images in memory
-	@ini_set('memory_limit', '256M');
+	@ini_set('memory_limit', WP_MAX_MEMORY_LIMIT);
 	$image = imagecreatefromstring( file_get_contents( $file ) );
 
 	if ( !is_resource( $image ) )
Index: wp-settings.php
===================================================================
--- wp-settings.php	(revision 17523)
+++ wp-settings.php	(working copy)
@@ -20,7 +20,7 @@
 require( ABSPATH . WPINC . '/default-constants.php' );
 require( ABSPATH . WPINC . '/version.php' );
 
-// Set initial default constants including WP_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE.
+// Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE.
 wp_initial_constants( );
 
 // Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php.
Index: wp-admin/includes/image-edit.php
===================================================================
--- wp-admin/includes/image-edit.php	(revision 17523)
+++ wp-admin/includes/image-edit.php	(working copy)
@@ -391,7 +391,7 @@
 
 function stream_preview_image($post_id) {
 	$post = get_post($post_id);
-	@ini_set('memory_limit', '256M');
+	@ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
 	$img = load_image_to_edit( $post_id, $post->post_mime_type, array(400, 400) );
 
 	if ( !is_resource($img) )
@@ -496,7 +496,7 @@
 	$return = new stdClass;
 	$success = $delete = $scaled = $nocrop = false;
 	$post = get_post($post_id);
-	@ini_set('memory_limit', '256M');
+	@ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
 	$img = load_image_to_edit($post_id, $post->post_mime_type);
 
 	if ( !is_resource($img) ) {
