Index: branches/img_metadata/phase3/includes/media/GIFMetadataExtractor.php |
— | — | @@ -130,8 +130,15 @@ |
131 | 131 | wfRestoreWarnings(); |
132 | 132 | } |
133 | 133 | |
134 | | - $comment[] = $data; |
135 | | - |
| 134 | + $commentCount = count( $comment ); |
| 135 | + if ( $commentCount === 0 |
| 136 | + || $comment[$commentCount-1] !== $data ) |
| 137 | + { |
| 138 | + // Some applications repeat the same comment on each |
| 139 | + // frame of an animated GIF image, so if this comment |
| 140 | + // is identical to the last, only extract once. |
| 141 | + $comment[] = $data; |
| 142 | + } |
136 | 143 | } elseif ($extension_code == 0xFF) { |
137 | 144 | // Application extension (Netscape info about the animated gif) |
138 | 145 | // or XMP (or theoretically any other type of extension block) |