23 'wgEnableAutoRotation' =>
true,
38 if ( !$this->
handler->canRotate() ) {
39 $this->
markTestSkipped(
"This test needs a rasterizer that can auto-rotate." );
42 $this->
assertEquals( $info[
'width'], $file->getWidth(),
"$name: width check" );
43 $this->
assertEquals( $info[
'height'], $file->getHeight(),
"$name: height check" );
59 $this->
assertEquals( $info[
'width'], $file->getWidth(),
"$name: width check" );
60 $this->
assertEquals( $info[
'height'], $file->getHeight(),
"$name: height check" );
68 if ( !$this->
handler->canRotate() ) {
69 $this->
markTestSkipped(
"This test needs a rasterizer that can auto-rotate." );
71 foreach ( $thumbs as $size =>
$out ) {
82 throw new MWException(
'bogus test data format ' . $size );
91 "$name: thumb reported width check for $size"
96 "$name: thumb reported height check for $size"
100 if (
$out[0] > $info[
'width'] ) {
102 $this->
assertEquals( $info[
'width'], $gis[0],
"$name: thumb actual width check for $size" );
103 $this->
assertEquals( $info[
'height'], $gis[1],
"$name: thumb actual height check for $size" );
105 $this->
assertEquals(
$out[0], $gis[0],
"$name: thumb actual width check for $size" );
106 $this->
assertEquals(
$out[1], $gis[1],
"$name: thumb actual height check for $size" );
114 'landscape-plain.jpg',
121 '800x600px' => [ 800, 600 ],
122 '9999x800px' => [ 1067, 800 ],
123 '800px' => [ 800, 600 ],
124 '600px' => [ 600, 450 ],
128 'portrait-rotated.jpg',
135 '800x600px' => [ 450, 600 ],
136 '9999x800px' => [ 600, 800 ],
137 '800px' => [ 800, 1067 ],
138 '600px' => [ 600, 800 ],
152 $this->
assertEquals( $info[
'width'], $file->getWidth(),
"$name: width check" );
153 $this->
assertEquals( $info[
'height'], $file->getHeight(),
"$name: height check" );
165 $this->
assertEquals( $info[
'width'], $file->getWidth(),
"$name: width check" );
166 $this->
assertEquals( $info[
'height'], $file->getHeight(),
"$name: height check" );
176 foreach ( $thumbs as $size =>
$out ) {
187 throw new MWException(
'bogus test data format ' . $size );
193 if ( $thumb->isError() ) {
195 $this->fail( $thumb->toText() );
201 "$name: thumb reported width check for $size"
206 "$name: thumb reported height check for $size"
210 if (
$out[0] > $info[
'width'] ) {
212 $this->
assertEquals( $info[
'width'], $gis[0],
"$name: thumb actual width check for $size" );
213 $this->
assertEquals( $info[
'height'], $gis[1],
"$name: thumb actual height check for $size" );
215 $this->
assertEquals(
$out[0], $gis[0],
"$name: thumb actual width check for $size" );
216 $this->
assertEquals(
$out[1], $gis[1],
"$name: thumb actual height check for $size" );
224 'landscape-plain.jpg',
231 '800x600px' => [ 800, 600 ],
232 '9999x800px' => [ 1067, 800 ],
233 '800px' => [ 800, 600 ],
234 '600px' => [ 600, 450 ],
238 'portrait-rotated.jpg',
245 '800x600px' => [ 800, 600 ],
246 '9999x800px' => [ 1067, 800 ],
247 '800px' => [ 800, 600 ],
248 '600px' => [ 600, 450 ],
261 $result = $this->
handler->extractPreRotationDimensions( [
262 'physicalWidth' => self::TEST_WIDTH,
263 'physicalHeight' => self::TEST_HEIGHT,
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
Generic handler for bitmap images.
Tests related to auto rotation.
testMetadataAutoRotate( $name, $type, $info)
Same as before, but with auto-rotation set to auto.
testBitmapExtractPreRotationDimensions( $rotation, $expected)
provideBitmapExtractPreRotationDimensions
testRotationRenderingNoAutoRotate( $name, $type, $info, $thumbs)
provideFilesNoAutoRotate
static provideBitmapExtractPreRotationDimensions()
static provideFilesNoAutoRotate()
testMetadataNoAutoRotate( $name, $type, $info)
Same as before, but with auto-rotation disabled.
testMetadata( $name, $type, $info)
provideFiles
testRotationRendering( $name, $type, $info, $thumbs)
provideFiles
testMetadataAutoRotateUnsupported( $name, $type, $info)
Same as before, but with auto-rotation set to auto and an image scaler that doesn't support it.
createsThumbnails()
Mark this test as creating thumbnail files.
const RENDER_NOW
Force rendering in the current process.
const RENDER_FORCE
Force rendering even if thumbnail already exist and using RENDER_NOW I.e.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable modifiable after all normalizations have been except for the $wgMaxImageArea check set to true or false to override the $wgMaxImageArea check result gives extension the possibility to transform it themselves set to a MediaTransformOutput the error message to be returned in an array you should do so by altering $wgNamespaceProtection and $wgNamespaceContentModels outside the handler
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out