Index: wp-includes/class-wp-image-editor-gd.php
===================================================================
--- wp-includes/class-wp-image-editor-gd.php	(revision 26816)
+++ wp-includes/class-wp-image-editor-gd.php	(working copy)
@@ -193,8 +193,8 @@
 	 *     An array of image size arrays. Default sizes are 'small', 'medium', 'large'.
 	 *
 	 *     @type array $size {
-	 *         @type int  $width  Image width.
-	 *         @type int  $height Image height.
+	 *         @type int/null  $width  Image width.
+	 *         @type int/null  $height Image height.
 	 *         @type bool $crop   Optional. Whether to crop the image. Default false.
 	 *     }
 	 * }
@@ -205,9 +205,23 @@
 		$orig_size = $this->size;
 
 		foreach ( $sizes as $size => $size_data ) {
-			if ( ! ( isset( $size_data['width'] ) && isset( $size_data['height'] ) ) )
-				continue;
+			//  are both width and height set
+			if ( ! ( isset( $size_data['width'] ) && isset( $size_data['height'] ) ) ){
+				// check both aren't null
+				if( null === $size_data['width'] &&  null === $size_data['height']){
+					continue;
+				}
 
+				// if check that only width is null and set to max int if so
+				if( null === $size_data['width'] ){
+					$size_data['width'] = PHP_INT_MAX-1;
+				}
+				// if check that only height is null and set to max int if so
+				if ( null === $size_data['height'] ){
+					$size_data['height'] = PHP_INT_MAX-1;
+				}
+			}
+
 			if ( ! isset( $size_data['crop'] ) )
 				$size_data['crop'] = false;
 
Index: wp-includes/class-wp-image-editor-imagick.php
===================================================================
--- wp-includes/class-wp-image-editor-imagick.php	(revision 26816)
+++ wp-includes/class-wp-image-editor-imagick.php	(working copy)
@@ -256,8 +256,8 @@
 	 *     An array of image size arrays. Default sizes are 'small', 'medium', 'large'.
 	 *
 	 *     @type array $size {
-	 *         @type int  $width  Image width.
-	 *         @type int  $height Image height.
+	 *         @type int/null  $width  Image width.
+	 *         @type int/null  $height Image height.
 	 *         @type bool $crop   Optional. Whether to crop the image. Default false.
 	 *     }
 	 * }
@@ -272,9 +272,22 @@
 			if ( ! $this->image )
 				$this->image = $orig_image->getImage();
 
-			if ( ! ( isset( $size_data['width'] ) && isset( $size_data['height'] ) ) )
-				continue;
+			if ( ! ( isset( $size_data['width'] ) && isset( $size_data['height'] ) ) ){
+				// check both aren't null
+				if( null === $size_data['width'] &&  null === $size_data['height']){
+					continue;
+				}
 
+				// if check that only width is null and set to max int if so
+				if( null === $size_data['width'] ){
+					$size_data['width'] = PHP_INT_MAX-1;
+				}
+				// if check that only height is null and set to max int if so
+				if ( null === $size_data['height'] ){
+					$size_data['height'] = PHP_INT_MAX-1;
+				}
+			}
+
 			if ( ! isset( $size_data['crop'] ) )
 				$size_data['crop'] = false;
 
