Changeset 59589 for trunk/tests/phpunit/tests/image/editorImagick.php
- Timestamp:
- 01/07/2025 10:33:37 PM (17 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/image/editorImagick.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/editorImagick.php
r59588 r59589 759 759 return 8; 760 760 } 761 762 /** 763 * Test that resizes are smaller for 16 bit PNG images. 764 * 765 * @ticket 36477 766 * 767 * @dataProvider data_resizes_are_small_for_16bit_images 768 */ 769 public function test_resizes_are_small_for_16bit_images( $file ) { 770 771 $temp_file = DIR_TESTDATA . '/images/test-temp.png'; 772 773 $imagick_image_editor = new WP_Image_Editor_Imagick( $file ); 774 $imagick_image_editor->load(); 775 $size = $imagick_image_editor->get_size(); 776 777 $org_filesize = filesize( $file ); 778 779 $imagick_image_editor->resize( $size['width'] * .5, $size['height'] * .5 ); 780 781 $saved = $imagick_image_editor->save( $temp_file ); 782 783 $new_filesize = filesize( $temp_file ); 784 785 unlink( $temp_file ); 786 787 $this->assertLessThan( $org_filesize, $new_filesize, 'The resized image file size is not smaller than the original file size.' ); 788 } 789 790 /** 791 * data_test_resizes_are_small_for_16bit 792 * 793 * @return array[] 794 */ 795 public static function data_resizes_are_small_for_16bit_images() { 796 return array( 797 'cloudflare-status' => array( 798 DIR_TESTDATA . '/images/png-tests/cloudflare-status.png', 799 ), 800 'deskcat8' => array( 801 DIR_TESTDATA . '/images/png-tests/deskcat8.png', 802 ), 803 '17-c3-duplicate-entries' => array( 804 DIR_TESTDATA . '/images/png-tests/Palette_icon-or8.png', 805 ), 806 'rabbit-time-paletted' => array( 807 DIR_TESTDATA . '/images/png-tests/rabbit-time-paletted-or8.png', 808 ), 809 'test8' => array( 810 DIR_TESTDATA . '/images/png-tests/test8.png', 811 ), 812 ); 813 } 761 814 }
Note: See TracChangeset
for help on using the changeset viewer.