Index: trunk/phase3/tests/phpunit/includes/media/JpegMetadataExtractorTest.php |
— | — | @@ -12,10 +12,25 @@ |
13 | 13 | $this->filePath = dirname( __FILE__ ) . '/../../data/media/'; |
14 | 14 | } |
15 | 15 | |
16 | | - public function testUtf8Comment() { |
17 | | - $res = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-comment-utf.jpg' ); |
| 16 | + /** |
| 17 | + * We also use this test to test padding bytes don't |
| 18 | + * screw stuff up |
| 19 | + * |
| 20 | + * @param $file filename |
| 21 | + * |
| 22 | + * @dataProvider dataUtf8Comment |
| 23 | + */ |
| 24 | + public function testUtf8Comment( $file ) { |
| 25 | + $res = JpegMetadataExtractor::segmentSplitter( $this->filePath . $file ); |
18 | 26 | $this->assertEquals( array( 'UTF-8 JPEG Comment — ¼' ), $res['COM'] ); |
19 | 27 | } |
| 28 | + public function dataUtf8Comment() { |
| 29 | + return array( |
| 30 | + array( 'jpeg-comment-utf.jpg' ), |
| 31 | + array( 'jpeg-padding-even.jpg' ), |
| 32 | + array( 'jpeg-padding-odd.jpg' ), |
| 33 | + ); |
| 34 | + } |
20 | 35 | /** The file is iso-8859-1, but it should get auto converted */ |
21 | 36 | public function testIso88591Comment() { |
22 | 37 | $res = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-comment-iso8859-1.jpg' ); |
Index: trunk/phase3/tests/phpunit/data/media/jpeg-padding-even.jpg |
Cannot display: file marked as a binary type. |
svn:mime-type = image/jpeg |
Property changes on: trunk/phase3/tests/phpunit/data/media/jpeg-padding-even.jpg |
___________________________________________________________________ |
Added: svn:mime-type |
23 | 38 | + image/jpeg |
Index: trunk/phase3/tests/phpunit/data/media/README |
— | — | @@ -25,7 +25,8 @@ |
26 | 26 | jpeg-comment-iso8859-1.jpg, jpeg-comment-binary.jpg, jpeg-xmp-psir.jpg, |
27 | 27 | jpeg-xmp-alt.jpg, animated.gif, exif-user-comment.jpg, animated-xmp.gif, |
28 | 28 | iptc-timetest-invalid.jpg, jpeg-iptc-bad-hash.jpg, iptc-timetest.jpg, |
29 | | -xmp.png, nonanimated.gif, exif-gps.jpg, jpeg-xmp-psir.xmp, jpeg-iptc-good-hash.jpg |
| 29 | +xmp.png, nonanimated.gif, exif-gps.jpg, jpeg-xmp-psir.xmp, jpeg-iptc-good-hash.jpg, |
| 30 | +jpeg-padding-even.jpg, jpeg-padding-odd.jpg |
30 | 31 | Are all by Bawolff. I don't think they contain enough originality to |
31 | 32 | claim copyright, but on the off chance they do, feel free to use them |
32 | 33 | however you feel fit, without restriction. |
Index: trunk/phase3/tests/phpunit/data/media/jpeg-padding-odd.jpg |
Cannot display: file marked as a binary type. |
svn:mime-type = image/jpeg |
Property changes on: trunk/phase3/tests/phpunit/data/media/jpeg-padding-odd.jpg |
___________________________________________________________________ |
Added: svn:mime-type |
33 | 34 | + image/jpeg |