Merge "HooksTest: Covers Hooks::callHook too"
[lhc/web/wiklou.git] / includes / media / XCF.php
index 526b45e..3587eba 100644 (file)
@@ -56,7 +56,7 @@ class XCFHandler extends BitmapHandler {
        /**
         * Get width and height from the XCF header.
         *
-        * @param File $image
+        * @param File|FSFile $image
         * @param string $filename
         * @return array
         */
@@ -67,7 +67,7 @@ class XCFHandler extends BitmapHandler {
                }
 
                # Forge a return array containing metadata information just like getimagesize()
-               # See PHP documentation at: http://www.php.net/getimagesize
+               # See PHP documentation at: https://secure.php.net/getimagesize
                return [
                        0 => $header['width'],
                        1 => $header['height'],
@@ -149,31 +149,30 @@ class XCFHandler extends BitmapHandler {
         *
         * Greyscale files need different command line options.
         *
-        * @param File $file The image object, or false if there isn't one.
+        * @param File|FSFile $file The image object, or false if there isn't one.
         *   Warning, FSFile::getPropsFromPath might pass an (object)array() instead (!)
         * @param string $filename The filename
         * @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.
                        // Unclear from base media type if it has an alpha layer,
                        // so just assume that it does since it "potentially" could.
                        switch ( $header['base_type'] ) {
-                       case 0:
-                               $metadata['colorType'] = 'truecolour-alpha';
-                               break;
-                       case 1:
-                               $metadata['colorType'] = 'greyscale-alpha';
-                               break;
-                       case 2:
-                               $metadata['colorType'] = 'index-coloured';
-                               break;
-                       default:
-                               $metadata['colorType'] = 'unknown';
-
+                               case 0:
+                                       $metadata['colorType'] = 'truecolour-alpha';
+                                       break;
+                               case 1:
+                                       $metadata['colorType'] = 'greyscale-alpha';
+                                       break;
+                               case 2:
+                                       $metadata['colorType'] = 'index-coloured';
+                                       break;
+                               default:
+                                       $metadata['colorType'] = 'unknown';
                        }
                } else {
                        // Marker to prevent repeated attempted extraction