X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fmedia%2FPNGMetadataExtractor.php;h=c12ca0bf10414b61a8ce7c7a7393bc8d4b7b8658;hb=06dfb9c12da19f2de2da22d92938f3eca06cf682;hp=d0517d7a56ccebdae25a02dabf935063b7d3dd8c;hpb=1674c8413a4ec5065040408a8cbdb948c74bf6fa;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/media/PNGMetadataExtractor.php b/includes/media/PNGMetadataExtractor.php index d0517d7a56..c12ca0bf10 100644 --- a/includes/media/PNGMetadataExtractor.php +++ b/includes/media/PNGMetadataExtractor.php @@ -121,6 +121,8 @@ class PNGMetadataExtractor { if ( !$buf || strlen( $buf ) < $chunk_size ) { throw new Exception( __METHOD__ . ": Read error" ); } + $width = unpack( 'N', substr( $buf, 0, 4 ) )[1]; + $height = unpack( 'N', substr( $buf, 4, 4 ) )[1]; $bitDepth = ord( substr( $buf, 8, 1 ) ); // Detect the color type in British English as per the spec // https://www.w3.org/TR/PNG/#11IHDR