X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2Ffile%2FUnregisteredLocalFile.php;h=5ee25cd86c8082fd27a3f3ee4b58a40f01028038;hb=d821b71d1adb2ae6bb0fd16f221c6316978d506b;hp=5a3e4e9c7788c4c9502044652ede554a4498bf6b;hpb=b51729f77074984d4db7ff12e6d864c358292ec3;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 */