From: Brion Vibber Date: Mon, 13 Jun 2011 22:13:38 +0000 (+0000) Subject: Start on test cases for bug 6672 (Exif orientation support), follow up to r79845. X-Git-Tag: 1.31.0-rc.0~29548 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=b1f5c819429001d23c61d8b1f8c00ae077254748;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/tests/phpunit/includes/media/ExifRotationTest.php b/tests/phpunit/includes/media/ExifRotationTest.php new file mode 100644 index 0000000000..b3e2aaece6 --- /dev/null +++ b/tests/phpunit/includes/media/ExifRotationTest.php @@ -0,0 +1,44 @@ +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 + ) + ) + ); + } +} + diff --git a/tests/phpunit/includes/media/landscape-plain.jpg b/tests/phpunit/includes/media/landscape-plain.jpg new file mode 100644 index 0000000000..cf29655511 Binary files /dev/null and b/tests/phpunit/includes/media/landscape-plain.jpg differ diff --git a/tests/phpunit/includes/media/portrait-rotated.jpg b/tests/phpunit/includes/media/portrait-rotated.jpg new file mode 100644 index 0000000000..445feaedcf Binary files /dev/null and b/tests/phpunit/includes/media/portrait-rotated.jpg differ