8 protected function setUp() {
13 $this->filePath = __DIR__ .
'/../../data/media/';
32 '/Xmp-exif-multilingual_test.jpg' );
35 'x-default' =>
'right(iptc)',
36 'en' =>
'right translation',
40 $this->assertArrayHasKey(
'ImageDescription', $meta,
41 'Did not extract any ImageDescription info?!' );
43 $this->assertEquals( $expected, $meta[
'ImageDescription'] );
56 'jpeg-comment-utf.jpg' );
58 $this->assertEquals(
'UTF-8 JPEG Comment — ¼',
59 $meta[
'JPEGFileComment'][0] );
69 'iptc-invalid-psir.jpg' );
70 $this->assertEquals(
'Created with GIMP', $meta[
'JPEGFileComment'][0] );
78 'iptc-timetest.jpg' );
80 $this->assertEquals(
'2020:07:14 01:36:05', $meta[
'DateTimeDigitized'] );
81 $this->assertEquals(
'1997:03:02 00:01:02', $meta[
'DateTimeOriginal'] );
91 'iptc-timetest-invalid.jpg' );
93 $this->assertEquals(
'1845:03:02 00:01:02', $meta[
'DateTimeOriginal'] );
94 $this->assertFalse( isset( $meta[
'DateTimeDigitized'] ) );
106 $merger->addMetadata( [
'foo' =>
'xmp' ],
'xmp-general' );
107 $merger->addMetadata( [
'bar' =>
'xmp' ],
'xmp-general' );
108 $merger->addMetadata( [
'baz' =>
'xmp' ],
'xmp-general' );
109 $merger->addMetadata( [
'fred' =>
'xmp' ],
'xmp-general' );
110 $merger->addMetadata( [
'foo' =>
'iptc (hash)' ],
'iptc-good-hash' );
111 $merger->addMetadata( [
'bar' =>
'iptc (bad hash)' ],
'iptc-bad-hash' );
112 $merger->addMetadata( [
'baz' =>
'iptc (bad hash)' ],
'iptc-bad-hash' );
113 $merger->addMetadata( [
'fred' =>
'iptc (no hash)' ],
'iptc-no-hash' );
114 $merger->addMetadata( [
'baz' =>
'exif' ],
'exif' );
116 $actual = $merger->getMetadataArray();
119 'bar' =>
'iptc (bad hash)',
123 $this->assertEquals( $expected, $actual );
133 $result =
$handler->PNG( $this->filePath .
'xmp.png' );
139 'colorType' =>
'index-coloured',
141 'SerialNumber' =>
'123456789',
142 '_MW_PNG_VERSION' => 1,
145 $this->assertEquals( $expected, $result );
153 $result =
$handler->PNG( $this->filePath .
'Png-native-test.png' );
154 $expected =
'http://example.com/url';
155 $this->assertEquals( $expected, $result[
'metadata'][
'Identifier'][
'x-default'] );
163 $res =
$handler->getTiffByteOrder( $this->filePath .
'test.tiff' );
164 $this->assertEquals(
'LE',
$res );
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 $handler