/** * Calculate the size of a resized image * * @param integer $width Image width * @param integer $height Image height * @param integer $target Target size * * @return array The new width and height * * @since 3.2 * @deprecated 4.0 Use JHelperMedia::imageResize instead */ public static function imageResize($width, $height, $target) { JLog::add('MediaHelper::countFiles() is deprecated. Use JHelperMedia::countFiles() instead.', JLog::WARNING, 'deprecated'); $mediaHelper = new JHelperMedia(); return $mediaHelper->imageResize($width, $height, $target); }
/** * Tests the imageResize method * * @param string $fileName The filename * @param string $expected Expected result * * @return void * * @dataProvider imageResizeProvider * @since 3.2 */ public function testImageResize($width, $height, $target, $expected) { $newSize = $this->object->imageResize($width, $height, $target); $this->assertEquals($newSize, $expected); }