http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90016
Revision: 90016
Author: brion
Date: 2011-06-13 22:13:38 +0000 (Mon, 13 Jun 2011)
Log Message:
-----------
Start on test cases for bug 6672 (Exif orientation support), follow up to
r79845.
Unfortunately seem to be hitting a wall right off at checking width & height;
BitmapHandler reports back the pre-rotation width & height, leading to the
oddity that a file that's clearly 1024px tall and 768px wide reports itself as
1024px wide and 768px tall.
Haven't gotten to generating rotated output to confirm file size. :)
Marked test case as broken pending fix so it doesn't add to surprise
regressions in test reports.
Added Paths:
-----------
trunk/phase3/tests/phpunit/includes/media/ExifRotationTest.php
trunk/phase3/tests/phpunit/includes/media/landscape-plain.jpg
trunk/phase3/tests/phpunit/includes/media/portrait-rotated.jpg
Added: trunk/phase3/tests/phpunit/includes/media/ExifRotationTest.php
===================================================================
--- trunk/phase3/tests/phpunit/includes/media/ExifRotationTest.php
(rev 0)
+++ trunk/phase3/tests/phpunit/includes/media/ExifRotationTest.php
2011-06-13 22:13:38 UTC (rev 90016)
@@ -0,0 +1,44 @@
+<?php
+
+/**
+ * @group Broken
+ */
+class ExifRotationTest extends MediaWikiTestCase {
+
+ function setUp() {
+ }
+
+ /**
+ *
+ * @dataProvider providerFiles
+ */
+ function testMetadata( $name, $type, $info ) {
+ $handler = new BitmapHandler();
+
+ $file = UnregisteredLocalFile::newFromPath( dirname( __FILE__ )
. '/' . $name, $type );
+ $this->assertEquals( $file->getWidth(), $info['width'], "$name:
width check" );
+ $this->assertEquals( $file->getHeight(), $info['height'],
"$name: height check" );
+ }
+
+ function providerFiles() {
+ return array(
+ array(
+ 'landscape-plain.jpg',
+ 'image/jpeg',
+ array(
+ 'width' => 1024,
+ 'height' => 768,
+ )
+ ),
+ array(
+ 'portrait-rotated.jpg',
+ 'image/jpeg',
+ array(
+ 'width' => 768, // as rotated
+ 'height' => 1024, // as rotated
+ )
+ )
+ );
+ }
+}
+
Property changes on:
trunk/phase3/tests/phpunit/includes/media/ExifRotationTest.php
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/phase3/tests/phpunit/includes/media/landscape-plain.jpg
===================================================================
(Binary files differ)
Property changes on:
trunk/phase3/tests/phpunit/includes/media/landscape-plain.jpg
___________________________________________________________________
Added: svn:mime-type
+ image/jpeg
Added: trunk/phase3/tests/phpunit/includes/media/portrait-rotated.jpg
===================================================================
(Binary files differ)
Property changes on:
trunk/phase3/tests/phpunit/includes/media/portrait-rotated.jpg
___________________________________________________________________
Added: svn:mime-type
+ image/jpeg
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs