From 1f005a61e7bf6702899624b815fd2b53dbd40fa9 Mon Sep 17 00:00:00 2001 From: Isaiah DeRose-Wilson Date: Mon, 4 Jul 2011 16:25:05 -0400 Subject: [PATCH] Added tests for #3568 --- classes/kohana/image/gd.php | 5 +---- tests/kohana/ImageTest.php | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 tests/kohana/ImageTest.php diff --git a/classes/kohana/image/gd.php b/classes/kohana/image/gd.php index e80a633..e0ed852 100644 --- a/classes/kohana/image/gd.php +++ b/classes/kohana/image/gd.php @@ -527,15 +527,12 @@ class Kohana_Image_GD extends Image { */ protected function _save_function($extension, & $quality) { - if ( empty($extension) ) + if ( ! $extension) { // Use the current image type $extension = image_type_to_extension($this->type, FALSE); } - if ( ! $extension) - throw new Kohana_Exception('No image type specified.'); - switch (strtolower($extension)) { case 'jpg': diff --git a/tests/kohana/ImageTest.php b/tests/kohana/ImageTest.php new file mode 100644 index 0000000..ed92ab8 --- /dev/null +++ b/tests/kohana/ImageTest.php @@ -0,0 +1,26 @@ +assertTrue($image->save(Kohana::$cache_dir.'/test_image')); + + unlink(Kohana::$cache_dir.'/test_image'); + } + +} // End Kohana_ImageTest \ No newline at end of file -- 2.11.4.GIT