X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fmedia%2FXCF.php;h=6ac675e8fb2dca406d5a5b11b400637b6ba664d9;hb=32a8895637f270e4f6a0dec0c1d42cdd9cbaf6fd;hp=f8fa2521d3fc67cba51fb3e8a56bdb41da40d63b;hpb=9ba3fca2d8adc56787c8efc32c41424cb212e387;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/media/XCF.php b/includes/media/XCF.php index f8fa2521d3..6ac675e8fb 100644 --- a/includes/media/XCF.php +++ b/includes/media/XCF.php @@ -68,21 +68,15 @@ class XCFHandler extends BitmapHandler { # Forge a return array containing metadata information just like getimagesize() # See PHP documentation at: http://www.php.net/getimagesize - $metadata = []; - $metadata[0] = $header['width']; - $metadata[1] = $header['height']; - $metadata[2] = null; # IMAGETYPE constant, none exist for XCF. - $metadata[3] = sprintf( - 'height="%s" width="%s"', $header['height'], $header['width'] - ); - $metadata['mime'] = 'image/x-xcf'; - $metadata['channels'] = null; - $metadata['bits'] = 8; # Always 8-bits per color - - assert( '7 == count($metadata); ' . - '# return array must contains 7 elements just like getimagesize() return' ); - - return $metadata; + return [ + 0 => $header['width'], + 1 => $header['height'], + 2 => null, # IMAGETYPE constant, none exist for XCF. + 3 => "height=\"{$header['height']}\" width=\"{$header['width']}\"", + 'mime' => 'image/x-xcf', + 'channels' => null, + 'bits' => 8, # Always 8-bits per color + ]; } /** @@ -161,7 +155,7 @@ class XCFHandler extends BitmapHandler { * @return string */ public function getMetadata( $file, $filename ) { - $header = self::getXCFMetadata( $filename ); + $header = self::getXCFMetaData( $filename ); $metadata = []; if ( $header ) { // Try to be consistent with the names used by PNG files.