From 7e80ef1467c770fe0d10087abbb6ec35567ce7ae Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 20 Sep 2011 19:13:52 +0000 Subject: [PATCH] Partial revert of broken test changes from r92246 -- for some reason it was trying to test some random handler parameter normalization instead of the actual reported width/height! Confirms that returned width/height are incorrect for exif-rotated images. --- .../includes/media/ExifRotationTest.php | 27 ++----------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/tests/phpunit/includes/media/ExifRotationTest.php b/tests/phpunit/includes/media/ExifRotationTest.php index ea2b9831b6..74f5390cde 100644 --- a/tests/phpunit/includes/media/ExifRotationTest.php +++ b/tests/phpunit/includes/media/ExifRotationTest.php @@ -26,32 +26,9 @@ class ExifRotationTest extends MediaWikiTestCase { * @dataProvider providerFiles */ function testMetadata( $name, $type, $info ) { - # Force client side resizing - $params = array( 'width' => 10000, 'height' => 10000 ); $file = UnregisteredLocalFile::newFromPath( $this->filePath . $name, $type ); - - # Normalize parameters - $this->assertTrue( $this->handler->normaliseParams( $file, $params ) ); - $rotation = $this->handler->getRotation( $file ); - - # Check if pre-rotation dimensions are still good - list( $width, $height ) = $this->handler->extractPreRotationDimensions( $params, $rotation ); - $this->assertEquals( $file->getWidth(), $width, - "$name: pre-rotation width check, $rotation:$width" ); - $this->assertEquals( $file->getHeight(), $height, - "$name: pre-rotation height check, $rotation" ); - - # Any further test require a scaler that can rotate - if ( !BitmapHandler::canRotate() ) { - $this->markTestSkipped( 'Scaler does not support rotation' ); - return; - } - - # Check post-rotation width - $this->assertEquals( $params['physicalWidth'], $info['width'], - "$name: post-rotation width check" ); - $this->assertEquals( $params['physicalHeight'], $info['height'], - "$name: post-rotation height check" ); + $this->assertEquals( $file->getWidth(), $info['width'], "$name: width check" ); + $this->assertEquals( $file->getHeight(), $info['height'], "$name: height check" ); } function providerFiles() { -- 2.20.1