API: Added iiprop=bitdepth to imageinfo and aiprop=bitdepth to allimages
This commit is contained in:
parent
1172eb1071
commit
e2564980c3
6 changed files with 22 additions and 3 deletions
1
CREDITS
1
CREDITS
|
|
@ -6,6 +6,7 @@ following names for their contribution to the product.
|
|||
* Alexandre Emsenhuber
|
||||
* Aryeh Gregor
|
||||
* Brion Vibber
|
||||
* Bryan Tong Minh
|
||||
* Chad Horohoe
|
||||
* Greg Sabino Mullane
|
||||
* Hojjat
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
|
|||
or other engine which doesn't support a separate title search function.
|
||||
This means you can use API search on Wikipedia without explicitly adding
|
||||
&srwhat=text to the query.
|
||||
* Added iiprop=bitdepth to imageinfo and aiprop=bitdepth to allimages
|
||||
|
||||
|
||||
=== Languages updated in 1.14 ===
|
||||
|
|
|
|||
|
|
@ -162,7 +162,8 @@ class ApiQueryAllimages extends ApiQueryGeneratorBase {
|
|||
'dimensions', // Obsolete
|
||||
'mime',
|
||||
'sha1',
|
||||
'metadata'
|
||||
'metadata',
|
||||
'bitdepth',
|
||||
),
|
||||
ApiBase :: PARAM_DFLT => 'timestamp|url',
|
||||
ApiBase :: PARAM_ISMULTI => true
|
||||
|
|
|
|||
|
|
@ -148,6 +148,9 @@ class ApiQueryImageInfo extends ApiQueryBase {
|
|||
|
||||
if( isset( $prop['archivename'] ) && $file->isOld() )
|
||||
$vals['archivename'] = $file->getArchiveName();
|
||||
|
||||
if( isset( $prop['bitdepth'] ) )
|
||||
$vals['bitdepth'] = $file->getBitDepth();
|
||||
|
||||
return $vals;
|
||||
}
|
||||
|
|
@ -166,7 +169,8 @@ class ApiQueryImageInfo extends ApiQueryBase {
|
|||
'sha1',
|
||||
'mime',
|
||||
'metadata',
|
||||
'archivename'
|
||||
'archivename',
|
||||
'bitdepth',
|
||||
)
|
||||
),
|
||||
'limit' => array(
|
||||
|
|
|
|||
|
|
@ -264,7 +264,14 @@ abstract class File {
|
|||
* Overridden by LocalFile, UnregisteredLocalFile
|
||||
* STUB
|
||||
*/
|
||||
function getMetadata() { return false; }
|
||||
public function getMetadata() { return false; }
|
||||
|
||||
/**
|
||||
* Return the bit depth of the file
|
||||
* Overridden by LocalFile
|
||||
* STUB
|
||||
*/
|
||||
public function getBitDepth() { return 0; }
|
||||
|
||||
/**
|
||||
* Return the size of the image file, in bytes
|
||||
|
|
|
|||
|
|
@ -453,6 +453,11 @@ class LocalFile extends File
|
|||
return $this->metadata;
|
||||
}
|
||||
|
||||
function getBitDepth() {
|
||||
$this->load();
|
||||
return $this->bits;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the size of the image file, in bytes
|
||||
* @public
|
||||
|
|
|
|||
Loading…
Reference in a new issue