The File::getBitDepth() stub simply returns 0 and UnregisteredLocalFile was not
overriding this to return the actual bit depth. UnregisteredLocalFile::getBitDepth()
now handles this by returning the 'bits' field of $this->getImageSize().
This commit just fixes the above bug, but some rethinking of the structure and
behaviour of this class and the UploadStashFile class is required.
Bug: T36952
Change-Id: I4a8fd6b74b923f2052ccd2e47980486299ad2a6e
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
*/