r90016 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90015‎ | r90016 | r90017 >
Date:22:13, 13 June 2011
Author:brion
Status:ok
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/media/ExifRotationTest.php (added) (history)
  • /trunk/phase3/tests/phpunit/includes/media/landscape-plain.jpg (added) (history)
  • /trunk/phase3/tests/phpunit/includes/media/portrait-rotated.jpg (added) (history)

Diff [purge]

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
146 + 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
247 + 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
348 + image/jpeg

Follow-up revisions

RevisionCommit summaryAuthorDate
r90123add canvas scaling and rotation. mostly fixes bug 29383 (a few issues remaini...neilk17:35, 15 June 2011
r97656Further tweaks to r96687, r90016, r97398 etc tests: actually produce a thumbn...brion19:39, 20 September 2011
r97659Further tweaks to r96687, r90016, r97398, r97656 etc tests: try several thumb...brion20:04, 20 September 2011
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
r79845$wgMaxUploadSize may now be set to an array to specify the upload size limit ...btongminh22:12, 7 January 2011
r79859Follow-up r79845: add function documentation; only call wfMakeDirsParent if w...btongminh11:49, 8 January 2011

Status & tagging log