Merge "Move up devunt's name to Developers"
[lhc/web/wiklou.git] / includes / filerepo / file / UnregisteredLocalFile.php
index 5a3e4e9..5ee25cd 100644 (file)
@@ -103,7 +103,7 @@ class UnregisteredLocalFile extends File {
                if ( $mime ) {
                        $this->mime = $mime;
                }
-               $this->dims = array();
+               $this->dims = [];
        }
 
        /**
@@ -165,6 +165,18 @@ class UnregisteredLocalFile extends File {
                return $this->handler->getImageSize( $this, $this->getLocalRefPath() );
        }
 
+       /**
+       * @return int
+       */
+       function getBitDepth() {
+               $gis = $this->getImageSize( $this->getLocalRefPath() );
+
+               if ( !$gis || !isset( $gis['bits'] ) ) {
+                       return 0;
+               }
+               return $gis['bits'];
+       }
+
        /**
         * @return bool
         */