Ticket #48522: 48522.diff
File 48522.diff, 1.9 KB (added by , 5 years ago) |
---|
-
src/wp-admin/includes/image.php
301 301 } 302 302 } else { 303 303 // TODO: log errors. 304 $error_code = $saved->get_error_code(); 305 trigger_error( $error_code, E_USER_ERROR ); 306 exit; 304 307 } 305 308 } else { 306 // TODO: log errors. 309 $error_code = $resized->get_error_code(); 310 311 // The `error_getting_dimensions` error code means the original image is not large enough 312 // to create the requested sub-size. (Checked here for completeness.) 313 if ( $error_code !== 'error_getting_dimensions' ) { 314 // TODO: log errors. 315 trigger_error( $error_code, E_USER_ERROR ); 316 exit; 317 } 307 318 } 308 319 } elseif ( ! empty( $exif_meta['orientation'] ) && (int) $exif_meta['orientation'] !== 1 ) { 309 320 // Rotate the whole original image if there is EXIF data and "orientation" is not 1. … … 331 342 } 332 343 } else { 333 344 // TODO: log errors. 345 $error_code = $saved->get_error_code(); 346 trigger_error( $error_code, E_USER_ERROR ); 347 exit; 334 348 } 335 349 } 336 350 } … … 423 437 424 438 if ( is_wp_error( $rotated ) ) { 425 439 // TODO: log errors. 440 $error_code = $rotated->get_error_code(); 441 trigger_error( $error_code, E_USER_ERROR ); 442 exit; 426 443 } 427 444 } 428 445 … … 431 448 $new_size_meta = $editor->make_subsize( $new_size_data ); 432 449 433 450 if ( is_wp_error( $new_size_meta ) ) { 434 // TODO: log errors. 451 $error_code = $new_size_meta->get_error_code(); 452 453 // The `error_getting_dimensions` error code means the original image is not large enough 454 // to create the requested sub-size. 455 if ( $error_code !== 'error_getting_dimensions' ) { 456 // TODO: log errors. 457 trigger_error( $error_code, E_USER_ERROR ); 458 exit; 459 } 435 460 } else { 436 461 // Save the size meta value. 437 462 $image_meta['sizes'][ $new_size_name ] = $new_size_meta;