Ticket #26823: multi_resize_null_support_with_check_for_both_null.patch
File multi_resize_null_support_with_check_for_both_null.patch, 2.0 KB (added by , 11 years ago) |
---|
-
wp-includes/class-wp-image-editor-gd.php
205 205 $orig_size = $this->size; 206 206 207 207 foreach ( $sizes as $size => $size_data ) { 208 if ( ! ( isset( $size_data['width'] ) && isset( $size_data['height'] ) ) ) 208 // that we don't have NULL or 0 for both values 209 if ( 0 == ( absint( $size_data['width'] ) + absint( $size_data['height'] ) ) ){ 209 210 continue; 211 } 210 212 211 if ( ! isset( $size_data['crop'] ) ) 213 if ( ! isset( $size_data['crop'] ) ){ 212 214 $size_data['crop'] = false; 215 } 213 216 214 $image = $this->_resize( $size_data['width'], $size_data['height'], $size_data['crop'] );217 $image = $this->_resize( absint( $size_data['width'] ), absint( $size_data['height'] ), $size_data['crop'] ); 215 218 216 219 if( ! is_wp_error( $image ) ) { 217 220 $resized = $this->_save( $image ); -
wp-includes/class-wp-image-editor-imagick.php
272 272 if ( ! $this->image ) 273 273 $this->image = $orig_image->getImage(); 274 274 275 if ( ! ( isset( $size_data['width'] ) && isset( $size_data['height'] ) ) ) 275 // that we don't have NULL or 0 for both values 276 if ( 0 == ( absint( $size_data['width'] ) + absint( $size_data['height'] ) ) ){ 276 277 continue; 278 } 277 279 278 if ( ! isset( $size_data['crop'] ) ) 280 if ( ! isset( $size_data['crop'] ) ){ 279 281 $size_data['crop'] = false; 282 } 280 283 281 $resize_result = $this->resize( $size_data['width'], $size_data['height'], $size_data['crop'] );284 $resize_result = $this->resize( absint( $size_data['width'] ), absint( $size_data['height'] ), $size_data['crop'] ); 282 285 283 286 if( ! is_wp_error( $resize_result ) ) { 284 287 $resized = $this->_save( $this->image );