X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2Ffile%2FUnregisteredLocalFile.php;h=5ee25cd86c8082fd27a3f3ee4b58a40f01028038;hb=3bd5235bf69dea8cb304aaa68b60180829359321;hp=5a3e4e9c7788c4c9502044652ede554a4498bf6b;hpb=77c05999ee5b28226b8f39c7857e0235cc0a1131;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/file/UnregisteredLocalFile.php b/includes/filerepo/file/UnregisteredLocalFile.php index 5a3e4e9c77..5ee25cd86c 100644 --- a/includes/filerepo/file/UnregisteredLocalFile.php +++ b/includes/filerepo/file/UnregisteredLocalFile.php @@ -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 */