Changeset 53292
- Timestamp:
- 04/27/2022 05:19:52 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/image.php
r52837 r53292 62 62 if ( is_wp_error( $result ) ) { 63 63 return $result; 64 } 65 66 if ( ! empty( $result['path'] ) ) { 67 return $result['path']; 64 68 } 65 69 -
trunk/tests/phpunit/tests/image/functions.php
r52837 r53292 144 144 } 145 145 146 147 146 /** 148 147 * @ticket 50833 … … 342 341 343 342 return $classes; 343 } 344 345 /** 346 * @ticket 55403 347 */ 348 public function test_wp_crop_image_with_filtered_extension() { 349 add_filter( 'image_editor_output_format', array( $this, 'filter_image_editor_output_format' ) ); 350 $file = wp_crop_image( 351 DIR_TESTDATA . '/images/canola.jpg', 352 0, 353 0, 354 100, 355 100, 356 100, 357 100 358 ); 359 360 $this->assertNotWPError( $file ); 361 $this->assertFileExists( $file ); 362 363 unlink( $file ); 344 364 } 345 365 … … 660 680 } 661 681 682 public function filter_image_editor_output_format() { 683 return array_fill_keys( array( 'image/jpg', 'image/jpeg', 'image/png' ), 'image/webp' ); 684 } 685 662 686 public function filter_fallback_intermediate_image_sizes( $fallback_sizes, $metadata ) { 663 687 // Add the 'test-size' to the list of fallback sizes.
Note: See TracChangeset
for help on using the changeset viewer.