r97651 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97650‎ | r97651 | r97652 >
Date:19:13, 20 September 2011
Author:brion
Status:ok
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/media/ExifRotationTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/media/ExifRotationTest.php
@@ -26,32 +26,9 @@
2727 * @dataProvider providerFiles
2828 */
2929 function testMetadata( $name, $type, $info ) {
30 - # Force client side resizing
31 - $params = array( 'width' => 10000, 'height' => 10000 );
3230 $file = UnregisteredLocalFile::newFromPath( $this->filePath . $name, $type );
33 -
34 - # Normalize parameters
35 - $this->assertTrue( $this->handler->normaliseParams( $file, $params ) );
36 - $rotation = $this->handler->getRotation( $file );
37 -
38 - # Check if pre-rotation dimensions are still good
39 - list( $width, $height ) = $this->handler->extractPreRotationDimensions( $params, $rotation );
40 - $this->assertEquals( $file->getWidth(), $width,
41 - "$name: pre-rotation width check, $rotation:$width" );
42 - $this->assertEquals( $file->getHeight(), $height,
43 - "$name: pre-rotation height check, $rotation" );
44 -
45 - # Any further test require a scaler that can rotate
46 - if ( !BitmapHandler::canRotate() ) {
47 - $this->markTestSkipped( 'Scaler does not support rotation' );
48 - return;
49 - }
50 -
51 - # Check post-rotation width
52 - $this->assertEquals( $params['physicalWidth'], $info['width'],
53 - "$name: post-rotation width check" );
54 - $this->assertEquals( $params['physicalHeight'], $info['height'],
55 - "$name: post-rotation height check" );
 31+ $this->assertEquals( $file->getWidth(), $info['width'], "$name: width check" );
 32+ $this->assertEquals( $file->getHeight(), $info['height'], "$name: height check" );
5633 }
5734
5835 function providerFiles() {

Follow-up revisions

RevisionCommit summaryAuthorDate
r97671* (bug 6672, 31024) Fixes for handling of images with an EXIF orientation...brion22:13, 20 September 2011
r97675MFT r97651, r97656, r97659 updated test cases for bug 6672, 31024...brion22:40, 20 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r92246Follow-up r79845: Fix rotation. Turns out that we need to pass the pre-rotati...btongminh15:13, 15 July 2011

Status & tagging log