Merge "UnregisteredLocalFile.php: Override File::getBitDepth() stub"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 13 Feb 2015 18:25:12 +0000 (18:25 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 13 Feb 2015 18:25:12 +0000 (18:25 +0000)
includes/filerepo/file/UnregisteredLocalFile.php

index 5a3e4e9..4c11341 100644 (file)
@@ -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
         */