PDF Images: Avoid a PHP Warning when attempting to process a file without an extension.

Props chandrapatel for initial patch.
Fixes #39195.


git-svn-id: https://develop.svn.wordpress.org/trunk@39580 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2016-12-12 06:18:30 +00:00
parent caa1f1f88d
commit 24228daabf
4 changed files with 24 additions and 2 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

+11
View File
@@ -542,4 +542,15 @@ class Tests_Image_Editor_GD extends WP_Image_UnitTestCase {
unlink( $save_to_file );
}
/**
* Test WP_Image_Editor_GD handles extension-less images
* @ticket 39195
*/
public function test_image_non_existent_extension() {
$image_editor = new WP_Image_Editor_GD( DIR_TESTDATA.'/images/test-image-no-extension' );
$result = $image_editor->load();
$this->assertTrue( $result );
}
}
@@ -531,4 +531,15 @@ class Tests_Image_Editor_Imagick extends WP_Image_UnitTestCase {
$this->assertImageAlphaAtPointImagick( $save_to_file, array( 0, 0 ), $pre_rotate_alpha );
unlink( $save_to_file );
}
/**
* Test WP_Image_Editor_Imagick handles extension-less images
* @ticket 39195
*/
public function test_image_non_existent_extension() {
$image_editor = new WP_Image_Editor_Imagick( DIR_TESTDATA.'/images/test-image-no-extension' );
$result = $image_editor->load();
$this->assertTrue( $result );
}
}