42 $res = $this->
handler->isMetadataValid(
null,
'Something Invalid Here.' );
51 $meta =
'a:16:{s:10:"ImageWidth";i:20;s:11:"ImageLength";i:20;s:13:"BitsPerSample";a:3:{i:0;i:8;i:1;i:8;i:2;i:8;}s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:16:"ImageDescription";s:17:"Created with GIMP";s:12:"StripOffsets";i:8;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:3;s:12:"RowsPerStrip";i:64;s:15:"StripByteCounts";i:238;s:11:"XResolution";s:19:"1207959552/16777216";s:11:"YResolution";s:19:"1207959552/16777216";s:19:"PlanarConfiguration";i:1;s:14:"ResolutionUnit";i:2;s:22:"MEDIAWIKI_EXIF_VERSION";i:2;}';
52 $res = $this->
handler->isMetadataValid(
null, $meta );
61 $meta =
'a:16:{s:10:"ImageWidth";i:20;s:11:"ImageLength";i:20;s:13:"BitsPerSample";a:3:{i:0;i:8;i:1;i:8;i:2;i:8;}s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:16:"ImageDescription";s:17:"Created with GIMP";s:12:"StripOffsets";i:8;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:3;s:12:"RowsPerStrip";i:64;s:15:"StripByteCounts";i:238;s:11:"XResolution";s:19:"1207959552/16777216";s:11:"YResolution";s:19:"1207959552/16777216";s:19:"PlanarConfiguration";i:1;s:14:"ResolutionUnit";i:2;s:22:"MEDIAWIKI_EXIF_VERSION";i:1;}';
62 $res = $this->
handler->isMetadataValid(
null, $meta );
72 $meta =
'a:6:{s:9:"page_data";a:1:{i:1;a:5:{s:5:"width";i:643;s:6:"height";i:448;s:5:"alpha";s:4:"true";s:4:"page";i:1;s:6:"pixels";i:288064;}}s:10:"page_count";i:1;s:10:"first_page";i:1;s:9:"last_page";i:1;s:4:"exif";a:9:{s:10:"ImageWidth";i:643;s:11:"ImageLength";i:448;s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:4;s:12:"RowsPerStrip";i:50;s:19:"PlanarConfiguration";i:1;s:22:"MEDIAWIKI_EXIF_VERSION";i:1;}s:21:"TIFF_METADATA_VERSION";s:3:"1.4";}';
73 $res = $this->
handler->isMetadataValid(
null, $meta );
82 'foo' => [
'First',
'Second',
'_type' =>
'ol' ],
83 'MEDIAWIKI_EXIF_VERSION' => 2
85 $res = $this->
handler->convertMetadataVersion( $metadata, 2 );
86 $this->assertEquals( $metadata,
$res );
94 'foo' => [
'First',
'Second',
'_type' =>
'ol' ],
95 'bar' => [
'First',
'Second',
'_type' =>
'ul' ],
96 'baz' => [
'First',
'Second' ],
98 'MEDIAWIKI_EXIF_VERSION' => 2,
101 'foo' =>
"\n#First\n#Second",
102 'bar' =>
"\n*First\n*Second",
103 'baz' =>
"\n*First\n*Second",
105 'MEDIAWIKI_EXIF_VERSION' => 1,
107 $res = $this->
handler->convertMetadataVersion( $metadata, 1 );
108 $this->assertEquals( $expected,
$res );
116 'Software' => [ [
'GIMP',
'1.1' ] ],
117 'MEDIAWIKI_EXIF_VERSION' => 2,
120 'Software' =>
'GIMP (Version 1.1)',
121 'MEDIAWIKI_EXIF_VERSION' => 1,
123 $res = $this->
handler->convertMetadataVersion( $metadata, 1 );
124 $this->assertEquals( $expected,
$res );
132 'Software' => [
"GIMP 1.2",
"vim" ],
133 'MEDIAWIKI_EXIF_VERSION' => 2,
136 'Software' =>
"\n*GIMP 1.2\n*vim",
137 'MEDIAWIKI_EXIF_VERSION' => 1,
139 $res = $this->
handler->convertMetadataVersion( $metadata, 1 );
140 $this->assertEquals( $expected,
$res );
Stuff specific to JPEG and (built-in) TIFF handler.
testIsOldGood()
ExifBitmapHandler::isMetadataValid.
testIsOldBroken()
ExifBitmapHandler::isMetadataValid.
testConvertMetadataToOld()
ExifBitmapHandler::convertMetadataVersion.
testIsInvalid()
ExifBitmapHandler::isMetadataValid.
testIsBrokenFile()
ExifBitmapHandler::isMetadataValid.
testConvertMetadataSoftware()
ExifBitmapHandler::convertMetadataVersion.
ExifBitmapHandler $handler
testConvertMetadataLatest()
ExifBitmapHandler::convertMetadataVersion.
testPagedTiffHandledGracefully()
Handle metadata from paged tiff handler (gotten via instant commons) gracefully.
testConvertMetadataSoftwareNormal()
ExifBitmapHandler::convertMetadataVersion.
testGoodMetadata()
ExifBitmapHandler::isMetadataValid.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub 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