dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Add test for WikiPage::updateCategoryCounts"
[lhc/web/wiklou.git]
/
includes
/
media
/
GIFMetadataExtractor.php
diff --git
a/includes/media/GIFMetadataExtractor.php
b/includes/media/GIFMetadataExtractor.php
index
de409e7
..
ac5fc81
100644
(file)
--- a/
includes/media/GIFMetadataExtractor.php
+++ b/
includes/media/GIFMetadataExtractor.php
@@
-54,9
+54,9
@@
class GIFMetadataExtractor {
* @return array
*/
static function getMetadata( $filename ) {
* @return array
*/
static function getMetadata( $filename ) {
- self::$gifFrameSep = pack( "C", ord( "," ) );
- self::$gifExtensionSep = pack( "C", ord( "!" ) );
- self::$gifTerm = pack( "C", ord( ";" ) );
+ self::$gifFrameSep = pack( "C", ord( "," ) );
// 2C
+ self::$gifExtensionSep = pack( "C", ord( "!" ) );
// 21
+ self::$gifTerm = pack( "C", ord( ";" ) );
// 3B
$frameCount = 0;
$duration = 0.0;
$frameCount = 0;
$duration = 0.0;
@@
-82,8
+82,11
@@
class GIFMetadataExtractor {
throw new Exception( "Not a valid GIF file; header: $buf" );
}
throw new Exception( "Not a valid GIF file; header: $buf" );
}
- // Skip over width and height.
- fread( $fh, 4 );
+ // Read width and height.
+ $buf = fread( $fh, 2 );
+ $width = unpack( 'v', $buf )[1];
+ $buf = fread( $fh, 2 );
+ $height = unpack( 'v', $buf )[1];
// Read BPP
$buf = fread( $fh, 1 );
// Read BPP
$buf = fread( $fh, 1 );