r38312 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r38311‎ | r38312 | r38313 >
Date:20:10, 31 July 2008
Author:btongminh
Status:old
Tags:
Comment:
API: Added iiprop=bitdepth to imageinfo and aiprop=bitdepth to allimages
Modified paths:
  • /trunk/phase3/CREDITS (modified) (history)
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryAllimages.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryImageInfo.php (modified) (history)
  • /trunk/phase3/includes/filerepo/File.php (modified) (history)
  • /trunk/phase3/includes/filerepo/LocalFile.php (modified) (history)

Diff [purge]

Index: trunk/phase3/CREDITS
@@ -6,6 +6,7 @@
77 * Alexandre Emsenhuber
88 * Aryeh Gregor
99 * Brion Vibber
 10+* Bryan Tong Minh
1011 * Chad Horohoe
1112 * Greg Sabino Mullane
1213 * Hojjat
Index: trunk/phase3/includes/filerepo/LocalFile.php
@@ -453,6 +453,11 @@
454454 return $this->metadata;
455455 }
456456
 457+ function getBitDepth() {
 458+ $this->load();
 459+ return $this->bits;
 460+ }
 461+
457462 /**
458463 * Return the size of the image file, in bytes
459464 * @public
Index: trunk/phase3/includes/filerepo/File.php
@@ -264,9 +264,16 @@
265265 * Overridden by LocalFile, UnregisteredLocalFile
266266 * STUB
267267 */
268 - function getMetadata() { return false; }
 268+ public function getMetadata() { return false; }
269269
270270 /**
 271+ * Return the bit depth of the file
 272+ * Overridden by LocalFile
 273+ * STUB
 274+ */
 275+ public function getBitDepth() { return 0; }
 276+
 277+ /**
271278 * Return the size of the image file, in bytes
272279 * Overridden by LocalFile, UnregisteredLocalFile
273280 * STUB
Index: trunk/phase3/includes/api/ApiQueryImageInfo.php
@@ -148,6 +148,9 @@
149149
150150 if( isset( $prop['archivename'] ) && $file->isOld() )
151151 $vals['archivename'] = $file->getArchiveName();
 152+
 153+ if( isset( $prop['bitdepth'] ) )
 154+ $vals['bitdepth'] = $file->getBitDepth();
152155
153156 return $vals;
154157 }
@@ -166,7 +169,8 @@
167170 'sha1',
168171 'mime',
169172 'metadata',
170 - 'archivename'
 173+ 'archivename',
 174+ 'bitdepth',
171175 )
172176 ),
173177 'limit' => array(
Index: trunk/phase3/includes/api/ApiQueryAllimages.php
@@ -162,7 +162,8 @@
163163 'dimensions', // Obsolete
164164 'mime',
165165 'sha1',
166 - 'metadata'
 166+ 'metadata',
 167+ 'bitdepth',
167168 ),
168169 ApiBase :: PARAM_DFLT => 'timestamp|url',
169170 ApiBase :: PARAM_ISMULTI => true
Index: trunk/phase3/RELEASE-NOTES
@@ -56,6 +56,7 @@
5757 or other engine which doesn't support a separate title search function.
5858 This means you can use API search on Wikipedia without explicitly adding
5959 &srwhat=text to the query.
 60+* Added iiprop=bitdepth to imageinfo and aiprop=bitdepth to allimages
6061
6162
6263 === Languages updated in 1.14 ===

Status & tagging log