2
class GIFMetadataExtractorTest extends MediaWikiTestCase {
4
public function setUp() {
5
$this->mediaPath = dirname( __FILE__ ) . '/../../data/media/';
8
* Put in a file, and see if the metadata coming out is as expected.
9
* @param $filename String
10
* @param $expected Array The extracted metadata.
11
* @dataProvider dataGetMetadata
13
public function testGetMetadata( $filename, $expected ) {
14
$actual = GIFMetadataExtractor::getMetadata( $this->mediaPath . $filename );
15
$this->assertEquals( $expected, $actual );
17
public function dataGetMetadata() {
20
<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
21
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 7.30'>
22
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
24
<rdf:Description rdf:about=''
25
xmlns:Iptc4xmpCore='http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/'>
26
<Iptc4xmpCore:Location>The interwebs</Iptc4xmpCore:Location>
29
<rdf:Description rdf:about=''
30
xmlns:tiff='http://ns.adobe.com/tiff/1.0/'>
31
<tiff:Artist>Bawolff</tiff:Artist>
32
<tiff:ImageDescription>
34
<rdf:li xml:lang='x-default'>A file to test GIF</rdf:li>
36
</tiff:ImageDescription>
66
$xmpNugget = str_replace( "\r", '', $xmpNugget ); // Windows compat
69
array( 'nonanimated.gif', array(
70
'comment' => array( 'GIF test file ⁕ Created with GIMP' ),
77
array( 'animated.gif', array(
78
'comment' => array( 'GIF test file . Created with GIMP' ),
86
array( 'animated-xmp.gif', array(
91
'comment' => array( 'GIƒ·test·file' ),