Index: trunk/phase3/tests/phpunit/includes/media/ExifRotationTest.php |
— | — | @@ -0,0 +1,44 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * @group Broken |
| 6 | + */ |
| 7 | +class ExifRotationTest extends MediaWikiTestCase { |
| 8 | + |
| 9 | + function setUp() { |
| 10 | + } |
| 11 | + |
| 12 | + /** |
| 13 | + * |
| 14 | + * @dataProvider providerFiles |
| 15 | + */ |
| 16 | + function testMetadata( $name, $type, $info ) { |
| 17 | + $handler = new BitmapHandler(); |
| 18 | + |
| 19 | + $file = UnregisteredLocalFile::newFromPath( dirname( __FILE__ ) . '/' . $name, $type ); |
| 20 | + $this->assertEquals( $file->getWidth(), $info['width'], "$name: width check" ); |
| 21 | + $this->assertEquals( $file->getHeight(), $info['height'], "$name: height check" ); |
| 22 | + } |
| 23 | + |
| 24 | + function providerFiles() { |
| 25 | + return array( |
| 26 | + array( |
| 27 | + 'landscape-plain.jpg', |
| 28 | + 'image/jpeg', |
| 29 | + array( |
| 30 | + 'width' => 1024, |
| 31 | + 'height' => 768, |
| 32 | + ) |
| 33 | + ), |
| 34 | + array( |
| 35 | + 'portrait-rotated.jpg', |
| 36 | + 'image/jpeg', |
| 37 | + array( |
| 38 | + 'width' => 768, // as rotated |
| 39 | + 'height' => 1024, // as rotated |
| 40 | + ) |
| 41 | + ) |
| 42 | + ); |
| 43 | + } |
| 44 | +} |
| 45 | + |
Property changes on: trunk/phase3/tests/phpunit/includes/media/ExifRotationTest.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 46 | + native |
Index: trunk/phase3/tests/phpunit/includes/media/portrait-rotated.jpg |
Cannot display: file marked as a binary type. |
svn:mime-type = image/jpeg |
Property changes on: trunk/phase3/tests/phpunit/includes/media/portrait-rotated.jpg |
___________________________________________________________________ |
Added: svn:mime-type |
2 | 47 | + image/jpeg |
Index: trunk/phase3/tests/phpunit/includes/media/landscape-plain.jpg |
Cannot display: file marked as a binary type. |
svn:mime-type = image/jpeg |
Property changes on: trunk/phase3/tests/phpunit/includes/media/landscape-plain.jpg |
___________________________________________________________________ |
Added: svn:mime-type |
3 | 48 | + image/jpeg |