--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE svg>\r
+<svg width="150" height="150" viewBox="-105 -105 210 210" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\r
+ <defs>\r
+ <clipPath id="ball">\r
+ <circle r="100" stroke-width="0"/>\r
+ </clipPath>\r
+ <radialGradient id="shadow1" cx=".4" cy=".3" r=".8">\r
+ <stop offset="0" stop-color="white" stop-opacity="1"/>\r
+ <stop offset=".4" stop-color="white" stop-opacity="1"/>\r
+ <stop offset=".8" stop-color="#EEEEEE" stop-opacity="1"/>\r
+ </radialGradient>\r
+ <radialGradient id="shadow2" cx=".5" cy=".5" r=".5">\r
+ <stop offset="0" stop-color="white" stop-opacity="0"/>\r
+ <stop offset=".8" stop-color="white" stop-opacity="0"/>\r
+ <stop offset=".99" stop-color="black" stop-opacity=".3"/>\r
+ <stop offset="1" stop-color="black" stop-opacity="1"/>\r
+ </radialGradient>\r
+ <g id="black_stuff" stroke-linejoin="round" clip-path="url(#ball)">\r
+ <g fill="black">\r
+ <path d="M 6,-32 Q 26,-28 46,-19 Q 57,-35 64,-47 Q 50,-68 37,-76 Q 17,-75 1,-68 Q 4,-51 6,-32"/>\r
+ <path d="M -26,-2 Q -45,-8 -62,-11 Q -74,5 -76,22 Q -69,40 -50,54 Q -32,47 -17,39 Q -23,15 -26,-2"/>\r
+ <path d="M -95,22 Q -102,12 -102,-8 V 80 H -85 Q -95,45 -95,22"/>\r
+ <path d="M 55,24 Q 41,41 24,52 Q 28,65 31,79 Q 55,78 68,67 Q 78,50 80,35 Q 65,28 55,24"/>\r
+ <path d="M 0,120 L -3,95 Q -25,93 -42,82 Q -50,84 -60,81"/>\r
+ <path d="M -90,-48 Q -80,-52 -68,-49 Q -52,-71 -35,-77 Q -35,-100 -40,-100 H -100"/>\r
+ <path d="M 100,-55 L 87,-37 Q 98,-10 97,5 L 100,6"/>\r
+ </g>\r
+ <g fill="none">\r
+ <path d="M 6,-32 Q -18,-12 -26,-2\r
+ M 46,-19 Q 54,5 55,24\r
+ M 64,-47 Q 77,-44 87,-37\r
+ M 37,-76 Q 39,-90 36,-100\r
+ M 1,-68 Q -13,-77 -35,-77\r
+ M -62,-11 Q -67,-25 -68,-49\r
+ M -76,22 Q -85,24 -95,22\r
+ M -50,54 Q -49,70 -42,82\r
+ M -17,39 Q 0,48 24,52\r
+ M 31,79 Q 20,92 -3,95\r
+ M 68,67 L 80,80\r
+ M 80,35 Q 90,25 97,5\r
+ "/>\r
+ </g>\r
+ </g>\r
+ </defs>\r
+ <circle r="100" fill="white" stroke="none"/>\r
+ <circle r="100" fill="url(#shadow1)" stroke="none"/>\r
+ <g><animateTransform attributeName="transform" attributeType="XML" type="rotate" from="0" to="360" begin="0s" dur="3s" repeatCount="indefinite"/>\r
+ <use xlink:href="#black_stuff" stroke="#EEE" stroke-width="7"/>\r
+ <use xlink:href="#black_stuff" stroke="#DDD" stroke-width="4"/>\r
+ <use xlink:href="#black_stuff" stroke="#999" stroke-width="2"/>\r
+ <use xlink:href="#black_stuff" stroke="black" stroke-width="1"/>\r
+ </g>\r
+ <circle r="100" fill="url(#shadow2)" stroke="none"/>\r
+</svg>\r
--- /dev/null
+<?php
+class FileTest extends MediaWikiMediaTestCase {
+
+ function setUp() {
+ $this->setMWGlobals( 'wgMaxAnimatedGifArea', 9000 );
+ parent::setUp();
+ }
+
+ /**
+ * @param $filename String
+ * @param $expected boolean
+ * @dataProvider providerCanAnimate
+ */
+ function testCanAnimateThumbIfAppropriate( $filename, $expected ) {
+ $file = $this->dataFile( $filename );
+ $this->assertEquals( $file->canAnimateThumbIfAppropriate(), $expected );
+ }
+
+ function providerCanAnimate() {
+ return array(
+ array( 'nonanimated.gif', true ),
+ array( 'jpeg-comment-utf.jpg', true ),
+ array( 'test.tiff', true ),
+ array( 'Animated_PNG_example_bouncing_beach_ball.png', false ),
+ array( 'greyscale-png.png', true ),
+ array( 'Toll_Texas_1.svg', true ),
+ array( 'LoremIpsum.djvu', true ),
+ array( '80x60-2layers.xcf', true ),
+ array( 'Soccer_ball_animated.svg', false ),
+ array( 'Bishzilla_blink.gif', false ),
+ array( 'animated.gif', true ),
+ );
+ }
+}